git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: lilinchao@oschina.cn
Cc: git <git@vger.kernel.org>
Subject: Re: protocol: add Accept-Language header if possible
Date: Fri, 03 Jun 2022 12:09:04 -0700	[thread overview]
Message-ID: <xmqqczfpfttb.fsf@gitster.g> (raw)
In-Reply-To: <202206040227197341312@oschina.cn> (lilinchao@oschina.cn's message of "Sat, 4 Jun 2022 02:33:30 +0800")

"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.

  reply	other threads:[~2022-06-03 19:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  3:18 protocol: add Accept-Language header if possible lilinchao
2022-06-03 18:33 ` lilinchao
2022-06-03 19:09   ` Junio C Hamano [this message]
2022-06-04  5:46     ` lilinchao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqczfpfttb.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=lilinchao@oschina.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).