[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24490: 25.1; restclient no longer sends auth header upon redirect
From: |
Thomas Fitzsimmons |
Subject: |
bug#24490: 25.1; restclient no longer sends auth header upon redirect |
Date: |
Wed, 14 Jul 2021 13:47:36 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Alain Picard <alain@gocatch.com> writes:
>>
>>> Dear Maintainers,
>>>
>>> In emacs 25.1,
>>> the code in url-http.el, line 638, states:
>>>
>>> ;; Do not automatically include an authorization header in the
>>> ;; redirect. If needed it will be regenerated by the relevant
>>> ;; auth scheme when the new request happens.
>>> (setq url-http-extra-headers
>>> (cl-remove "Authorization"
>>> url-http-extra-headers :key 'car :test 'equal))
>>>
>>> I suspect this automatic regenration does not occur.
>>
>> I think this code is basically correct -- if the auth scheme has added
>> something to url-http-extra-headers, then that has to be removed when
>> doing the redirect, because otherwise we might be sending the auth to a
>> completely wrong server, with the security implications of that.
>>
>>> Problem: I am using restclient.el, and hitting a server which
>>> issues a redirect, and I receive a 400 Forbidden response because
>>> the redirected call does not receive the authentication header
>>> (I can see this from the log of my server).
>>
>> I think this must be a bug in restclient.el -- it should instead use an
>> auth scheme that re-adds the Authorization header.
>
> It looks like restclient.el uses advice to skip
> url-http-handle-authentication if it (restclient) is in the middle of a
> request.
>
> Alain, to rule out that advice as being responsible, can you do:
>
> M-: (ad-deactivate 'url-http-handle-authentication)
>
> then try the API call again?
The email to "alain@gocatch.com" bounced, so I think we should probably
close this bug report.
Thomas