From b0c4adcdd7e339110bea8da94d7880d413e49330 Mon Sep 17 00:00:00 2001 From: Li Linchao Date: Mon, 11 Jul 2022 05:58:54 +0000 Subject: 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 Signed-off-by: Li Linchao Signed-off-by: Junio C Hamano --- http.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'http.h') diff --git a/http.h b/http.h index ba303cfb37..3c94c47910 100644 --- a/http.h +++ b/http.h @@ -178,6 +178,9 @@ int http_fetch_ref(const char *base, struct ref *ref); int http_get_info_packs(const char *base_url, struct packed_git **packs_head); +/* Helper for getting Accept-Language header */ +const char *http_get_accept_language_header(void); + struct http_pack_request { char *url; -- cgit v1.2.3