mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user