Procházet zdrojové kódy

content-type: do slightly more correct header parsing

Jelmer Vernooij před 1 rokem
rodič
revize
75b0369cca
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      dulwich/client.py

+ 1 - 1
dulwich/client.py

@@ -2007,7 +2007,7 @@ class AbstractHttpGitClient(GitClient):
         if isinstance(data, bytes):
             headers["Content-Length"] = str(len(data))
         resp, read = self._http_request(url, headers, data)
-        if not resp.content_type.startswith(result_content_type):
+        if resp.content_type.split(';')[0] != result_content_type:
             raise GitProtocolError(
                 "Invalid content-type from server: %s" % resp.content_type
             )