Skip to content

promhttp: fix panic on requests with nil URL#2065

Merged
kakkoyun merged 1 commit into
prometheus:mainfrom
SAY-5:fix-nil-url-panic
Jul 23, 2026
Merged

promhttp: fix panic on requests with nil URL#2065
kakkoyun merged 1 commit into
prometheus:mainfrom
SAY-5:fix-nil-url-panic

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #2064. The name[] filtering added in #1925 reads req.URL.Query() unconditionally, so serving a hand-constructed &http.Request{} (common in handler tests, worked fine before 1.24) now panics with a nil pointer dereference. Guard the URL before reading query params and add a regression test.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@kakkoyun
kakkoyun merged commit 436bf2e into prometheus:main Jul 23, 2026
15 checks passed
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.

panic: invalid memory address or nil pointer dereference in promhttp.HandlerForTransactional.func1

2 participants