From f18604bbf2c391c689a41fca14cbaeff5e106255 Mon Sep 17 00:00:00 2001 From: Yi EungJun Date: Wed, 28 Jan 2015 21:04:37 +0900 Subject: http: add Accept-Language header if possible Add an Accept-Language header which indicates the user's preferred languages defined by $LANGUAGE, $LC_ALL, $LC_MESSAGES and $LANG. Examples: LANGUAGE= -> "" LANGUAGE=ko:en -> "Accept-Language: ko, en;q=0.9, *;q=0.1" LANGUAGE=ko LANG=en_US.UTF-8 -> "Accept-Language: ko, *;q=0.1" LANGUAGE= LANG=en_US.UTF-8 -> "Accept-Language: en-US, *;q=0.1" This gives git servers a chance to display remote error messages in the user's preferred language. Limit the number of languages to 1,000 because q-value must not be smaller than 0.001, and limit the length of Accept-Language header to 4,000 bytes for some HTTP servers which cannot accept such long header. Signed-off-by: Yi EungJun Signed-off-by: Junio C Hamano --- remote-curl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'remote-curl.c') diff --git a/remote-curl.c b/remote-curl.c index dd63bc27ab..04989e5d7e 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -962,6 +962,8 @@ int main(int argc, const char **argv) struct strbuf buf = STRBUF_INIT; int nongit; + git_setup_gettext(); + git_extract_argv0_path(argv[0]); setup_git_directory_gently(&nongit); if (argc < 2) { -- cgit v1.2.3