Re: [PATCH] Prompt for a username when an HTTP request 401s
- From
Daniel Stenberg <daniel@haxx.se>
- Date
- Mar 19, 2010, 09:34 UTC
- Message-ID
- <alpine.DEB.2.00.1003191033022.15750@tvnag.unkk.fr>
- In-Reply-To
- <be6fef0d1003190213m48b6c91dx5cbd489cf798dacc@mail.gmail.com>
On Fri, 19 Mar 2010, Tay Ray Chuan wrote:
Show 10 quoted lines
>> When an HTTP request returns a 401, Git will currently fail with a >> confusing message saying that it got a 401. This changes http_request to >> prompt for the username and password, then return HTTP_REAUTH so >> http_get_strbuf can try again. If it gets a 401 even when a user/pass is >> supplied, http_request will now return HTTP_NOAUTH which remote_curl can >> then use to display a more intelligent error message that is less >> confusing. > > how are you getting 401s? Recently, git set the CURL_AUTH_ANY option, so if > the correct credentials are passed, curl should have "hid" the 401 from us.
That's correct. It should hide the 401 in the sense that it should try to continue and do the correct authentication procedure and only if that fails it should end up with an actual 401 end result.
-- / daniel.haxx.se