transports: http: fix custom headers not being applied - #5387
Conversation
|
Oops, what an embarassing oversight. Thanks @pks-t, this looks good to me. Maybe we should have a network test that adds an |
I'd definitely love to have a test. Let me see whether I can add one in online::clone using Basic auth. |
c6b04fc to
80b683f
Compare
|
Amended a test. The test works for me if setting up my own creds and fails without the fix. |
16dc76c to
46228d8
Compare
|
Modified the test to not require any environment variables being set, as that caused CI to skip it. |
In commit b9c5b15 (http: use the new httpclient, 2019-12-22), the HTTP code got refactored to extract a generic HTTP client that operates independently of the Git protocol. Part of refactoring was the creation of a new `git_http_request` struct that encapsulates the generation of requests. Our Git-specific HTTP transport was converted to use that in `generate_request`, but during the process we forgot to set up custom headers for the `git_http_request` and as a result we do not send out these headers anymore. Fix the issue by correctly setting up the request's custom headers and add a test to verify we correctly send them.
In commit b9c5b15 (http: use the new httpclient, 2019-12-22), the HTTP
code got refactored to extract a generic HTTP client that operates
independently of the Git protocol. Part of refactoring was the creation
of a new
git_http_requeststruct that encapsulates the generation ofrequests. Our Git-specific HTTP transport was converted to use that in
generate_request, but during the process we forgot to set up customheaders for the
git_http_requestand as a result we do not send outthese headers anymore.
Fix the issue by correctly setting up the request's custom headers.
Fixes #5385.