prometheus / prometheus/exporter-toolkit
CORS requests are failed if Basic Auth is enabled
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 311
- Forks
- 109
- Avg merge
- 3d 59m
- Merged PRs (30d)
- 6
Description
I enabled CORS headers and basic auth but a browser still can't fetch information from Prometheus.
Before sending a GET request an OPTIONS request is performed first and it doesn't contains the Authorization header.
So Prometheus must allow the OPTIONS request without the Authorization header.
I can do that with some Nginx configuration but I don't want to use just for this and also I want to keep configuration clear.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the exporter-toolkit code that handles CORS requests and Basic Auth, then reproduce the browser's unauthenticated OPTIONS preflight described in the issue. Done means the preflight is accepted without Authorization while protected requests still require Basic Auth; add or update the relevant tests if the existing code provides them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100