1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 08:47:56 +01:00
git/t/lib-httpd
Jeff King bf197fd7ee http: extract type/subtype portion of content-type
When we get a content-type from curl, we get the whole
header line, including any parameters, and without any
normalization (like downcasing or whitespace) applied.
If we later try to match it with strcmp() or even
strcasecmp(), we may get false negatives.

This could cause two visible behaviors:

  1. We might fail to recognize a smart-http server by its
     content-type.

  2. We might fail to relay text/plain error messages to
     users (especially if they contain a charset parameter).

This patch teaches the http code to extract and normalize
just the type/subtype portion of the string. This is
technically passing out less information to the callers, who
can no longer see the parameters. But none of the current
callers cares, and a future patch will add back an
easier-to-use method for accessing those parameters.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-27 09:57:00 -07:00
..
apache.conf t5550: test display of remote http error messages 2014-05-23 12:43:51 -07:00
broken-smart-http.sh t/lib-httpd: use write_script to copy CGI scripts 2014-05-23 12:41:50 -07:00
error.sh http: extract type/subtype portion of content-type 2014-05-27 09:57:00 -07:00
passwd use distinct username/password for http auth tests 2014-01-02 10:25:03 -08:00
ssl.cnf