config: fix file-backed http_headers path rebasing#912
Conversation
Signed-off-by: immanuwell <pchpr.00@list.ru>
89bb161 to
3c24acf
Compare
|
can you resolve conflicts? |
|
@roidelapluie done, conflicts are resolved |
|
Thanks for the patch and the detailed repro! I dug into this and I don't think the change in
I verified this empirically: the integration test in this PR passes against unmodified On the tests: the file-backed-header path through That said, while looking into this I think the real footgun is elsewhere: |
@roidelapluie @gotjosh small fix here, easy miss.
Headers.SetDirectorymutatesHeadervalues from a map copy, so paths fromhttp_headers.filesnever get written back.That makes file-backed headers fail when the HTTP config is loaded from a nested path, kind of a footgun.
This just writes the updated header back into the map and adds coverage for the helper and the real
LoadHTTPConfigFileplusNewClientFromConfigpath.Repro on
main:configs/http.yml.http_headerstofiles: [configs/header-value].LoadHTTPConfigFile, build a client, send a request.unable to read headers file.With this patch it reads the file and sends the header.