curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Authorization and Github

From: Gisle Vanem <gisle.vanem_at_gmail.com>
Date: Mon, 8 Oct 2018 11:22:18 +0200

Daniel Stenberg wrote:

> On Mon, 8 Oct 2018, Gisle Vanem wrote:
>
>> Very annoying and clumsy. Since with Wget it always works since it doesn't send this "Authorization:" header when
>> 'machine raw.githubusercontent.com ..' is present in '%APPDATA%/.netrc'.
>
> I'm not following. Is the problem that it sends the wrong header or that it finds the wrong credentials in the .netrc
> file or something else?

It seems to send the "Authorization: Basic..." header with a Base64 (?) value.
Github doesn't like that and responds with a 404.

Comparing to Google Chrome, it doesn't seems to send this header.
My credentials in the .netrc are correct.

If I disable gist.githubusercontent.com from the _netrc, even then this
header is sent. This auth-data is then coming the 'default login anonymous' line.
So I get another 404.

E.g.

c:\>curl -v https://gist.githubusercontent.com/gvanem/9c2fa42519e790b3bd20479f0dd7b4c7/raw/9acc048f75bd7ef735980
30fad3bd640dfc712da/Makefile.Windows
...
> GET /gvanem/9c2fa42519e790b3bd20479f0dd7b4c7/raw/9acc048f75bd7ef73598030fad3bd640dfc712da/Makefile.Windows HTTP/1.1
> Host: gist.githubusercontent.com
> Authorization: Basic YW5vbnltb3VzOnlvdXJAZW1haWwuYWRkcmVzcw==
...
< HTTP/1.1 404 Not Found

-- 
--gv
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-10-08