]> git.ipfire.org Git - thirdparty/git.git/commit - http.c
remote-curl: send Accept-Language header to server
authorLi Linchao <lilinchao@oschina.cn>
Mon, 11 Jul 2022 05:58:54 +0000 (05:58 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Jul 2022 19:24:28 +0000 (12:24 -0700)
commitb0c4adcdd7e339110bea8da94d7880d413e49330
tree3554a2e0abcefedb309d3d0a2ade3a898c704001
parent1e59178e3f65880188caedb965e70db5ceeb2d64
remote-curl: send Accept-Language header to server

Git server end's ability to accept Accept-Language header was introduced
in f18604bbf2 (http: add Accept-Language header if possible, 2015-01-28),
but this is only used by very early phase of the transfer, which is HTTP
GET request to discover references. For other phases, like POST request
in the smart HTTP, the server does not know what language the client
speaks.

Teach git client to learn end-user's preferred language and throw
accept-language header to the server side. Once the server gets this header,
it has the ability to talk to end-user with language they understand.
This would be very helpful for many non-English speakers.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Li Linchao <lilinchao@oschina.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c
http.h
remote-curl.c
t/t5541-http-push-smart.sh
t/t5550-http-fetch-dumb.sh
t/t5551-http-fetch-smart.sh