1. 18 6月, 2014 1 次提交
    • Y
      http: fix charset detection of extract_content_type() · f34a655d
      Yi EungJun 提交于
      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 <peff@peff.net>
      Signed-off-by: NYi EungJun <eungjun.yi@navercorp.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f34a655d
  2. 28 5月, 2014 2 次提交
    • J
      remote-curl: reencode http error messages · fc1b774c
      Jeff King 提交于
      We currently recognize an error message with a content-type
      "text/plain; charset=utf-16" as text, but we ignore the
      charset parameter entirely. Let's encode it to
      log_output_encoding, which is presumably something the
      user's terminal can handle.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fc1b774c
    • J
      http: extract type/subtype portion of content-type · bf197fd7
      Jeff King 提交于
      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: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bf197fd7
  3. 24 5月, 2014 1 次提交