http: don't enforce content-type

Proper git servers generally respond with a predictable content-type
(like `x-git-upload-pack-response`). But apparently not all do, and
we should not enforce that.
This commit is contained in:
Edward Thomson
2023-08-10 11:27:42 +01:00
parent 95f3d41364
commit 7b6de860a3

View File

@@ -290,11 +290,9 @@ static int handle_response(
return -1;
}
/* The Content-Type header must match our expectation. */
if (strcmp(response->content_type, stream->service->response_type) != 0) {
git_error_set(GIT_ERROR_HTTP, "invalid content-type: '%s'", response->content_type);
return -1;
}
/* The Content-Type header _should_ match our expectation. */
if (strcmp(response->content_type, stream->service->response_type) != 0)
git_trace(GIT_TRACE_INFO, "server sent content-type '%s' (expected '%s')", response->content_type, stream->service->response_type);
*complete = true;
stream->state = HTTP_STATE_RECEIVING_RESPONSE;