git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git clone sends first an empty authorization header

From
GGuilherme <guibufolo@gmail.com>
Date
Mar 5, 2016, 04:51 UTC
Message-ID
<CAMDzUty+O2Gu7o4bFib71AaNZn647WQ1v7ceiznHOs7-xwZGUg@mail.gmail.com>
Hi,

When doing basic authentication using git clone by passing the username and password in the url git clone will first send a GET request without the authorization header set.

Am i seeing this right?

This means that if the counterpart allows anonymous cloning but not pushing and the user provided a wrong usernam/password, it has two options:

1. Allow the access and leave the user to figure out why he is not able to push.
2. Reply by setting the WWW-Authentication header and see if a
password/username is provided. This has the downside that if no
username and password is provided the user will still get a login
prompt for password and username. Upon entering twice nothing he will
still be able to clone. This can be confusing.

Can this behaviour of git clone (and I guess all the other parts that do basic auth) be changed to provide the authentication header right on the first request? Or am I doing/interpreting it wrong?

Thank you.
Next: Bryan Turner
Message 1 of 4 in “Git clone sends first an empty authorization header”
  1. GuilhermeMar 5, 2016
  2. Bryan TurnerMar 5, 2016
  3. GuilhermeMar 5, 2016
  4. Andreas SchwabMar 5, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.