-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requests without an Accept
header are not accepted
#497
Comments
Hi; seems you're right, except the detail that the default for a missing Accept header should be OpenMetrics ( PRs welcome :) |
It's a bit complicated with branches in this repo right now, but to get it fixed in Quarkus, the most important branch for a PR would be |
@jmartisk Sent a PR to |
Main PR merged, if you're eager please send the same for |
Tk u. I'll send it now to |
Thanks. I will see to it that the fix is propagated into Quarkus 2.10.0 and 2.9.3 |
Ok |
Making a request without an
Accept
header ends up with the following response:In this case (the absence of an Accept header), the server should assume that the client accepts all types, i.e. /. This is defined in the HTTP spec here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Looks like the issue is on how the empty
Accept
header is handled here https://github.com/smallrye/smallrye-metrics/blob/main/implementation/src/main/java/io/smallrye/metrics/MetricsRequestHandler.java#L229.If empty, the server should respond with the preferred content type instead of not accepting the request. Perhaps use
application/json
as the default?FYI, this behavior was found in Quarkus applications using the
quarkus-smallrye-metrics
.If the issue makes sense, I can send a PR.
The text was updated successfully, but these errors were encountered: