From f34a655d4d1e25f314cd5760e2a39bec28950aa1 Mon Sep 17 00:00:00 2001 From: Yi EungJun Date: Wed, 18 Jun 2014 07:11:53 +0900 Subject: http: fix charset detection of extract_content_type() extract_content_type() could not extract a charset parameter if the parameter is not the first one and there is a whitespace and a following semicolon just before the parameter. For example: text/plain; format=fixed ;charset=utf-8 And it also could not handle correctly some other cases, such as: text/plain; charset=utf-8; format=fixed text/plain; some-param="a long value with ;semicolons;"; charset=utf-8 Thanks-to: Jeff King Signed-off-by: Yi EungJun Signed-off-by: Junio C Hamano --- t/lib-httpd/error.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/lib-httpd/error.sh') diff --git a/t/lib-httpd/error.sh b/t/lib-httpd/error.sh index eafc9d2d9..a77b8e546 100755 --- a/t/lib-httpd/error.sh +++ b/t/lib-httpd/error.sh @@ -19,6 +19,10 @@ case "$PATH_INFO" in printf "text/plain; charset=utf-16" charset=utf-16 ;; +*odd-spacing*) + printf "text/plain; foo=bar ;charset=utf-16; other=nonsense" + charset=utf-16 + ;; esac printf "\n" -- cgit v1.2.1