Skip to content

config: fix file-backed http_headers path rebasing#912

Open
immanuwell wants to merge 1 commit into
prometheus:mainfrom
immanuwell:fix-http-headers-setdirectory
Open

config: fix file-backed http_headers path rebasing#912
immanuwell wants to merge 1 commit into
prometheus:mainfrom
immanuwell:fix-http-headers-setdirectory

Conversation

@immanuwell
Copy link
Copy Markdown

@roidelapluie @gotjosh small fix here, easy miss.

Headers.SetDirectory mutates Header values from a map copy, so paths from http_headers.files never 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 LoadHTTPConfigFile plus NewClientFromConfig path.

Repro on main:

  1. Put an HTTP config in configs/http.yml.
  2. Set http_headers to files: [configs/header-value].
  3. Load it with LoadHTTPConfigFile, build a client, send a request.
  4. The request fails with unable to read headers file.

With this patch it reads the file and sends the header.

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell force-pushed the fix-http-headers-setdirectory branch from 89bb161 to 3c24acf Compare June 1, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant