소스 검색

content-type: do slightly more correct header parsing

Jelmer Vernooij 1 년 전
부모
커밋
75b0369cca
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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
             )