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

Re: protocol: add Accept-Language header if possible

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2022, 19:09 UTC
Message-ID
<xmqqczfpfttb.fsf@gitster.g>
In-Reply-To
<202206040227197341312@oschina.cn>
"lilinchao@oschina.cn" <lilinchao@oschina.cn> writes:

I am not your personal help-desk. Please don't Cc: questions to me unless it is a piece of code I wrote and am familiar with.

But since you added an explicit CC, let me try. Do not expect any high quality answers, though.

>>Git server end's ability to accept Accept-Language header was
>>introduced in f18604bbf2(http: add Accept-Language header if
>>possible) but it seems that only refs discovering stage has this
>>ability:

I do not think we do anything special on the server end. The said commit taught client side to learn end-user's locale and throw accept-language header at the other side.

I am not sure how much it helps in the smart HTTP, especially in later phases of the transfer, in the first place. Back in dumb HTTP walker days, a failure to fetch single object would have resulted in an error message generated by the webserver directly shown at the client end, but is that still true even if we use the smart HTTP to encapsulate the git native protocol exchange?

I highly suspect that any calls to get_accept_language() helper, or failure to call it, in the smart HTTP codepath is not something designed but just happened by accident. If it helps to issue the header to various requests, I think it would be good for consistency. Anything that uses http.c::http_request() should get the header for free, so depending on the reason why some requests do not use it, adding it might involve some refactoring, though.

Previous: lilinchao@oschina.cnNext: lilinchao@oschina.cn
Message 3 of 4 in “protocol: add Accept-Language header if possible”
  1. lilinchao@oschina.cnJun 2, 2022
  2. lilinchao@oschina.cnJun 3, 2022
  3. Junio C HamanoJun 3, 2022
  4. lilinchao@oschina.cnJun 4, 2022

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.