Closed majidghs closed 2 years ago
Our underlying libraries (hyperium/http, hyperium/h2, etc) don't give us much control over this. And, in fact, in the HTTP/2 ecosystem, I don't think that there's any sort of support for custom messages for HTTP status codes.
I think we're unlikely to support this. It's probably more robust to convey this type of information in response payloads rather than status message.
@olix0r Thanks for your reply.
What about the 400 status code? why linkerd changes the description to Bad Request
?
Linkerd uses Rust's http
crate. When it parses responses into a StatusCode
it only preserves the numeric status code value and when it serializes the response it uses the canonical status code message (e.g., "Bad Request").
I'm going to close this issue, since there's nothing we can do about this in the Linkerd project. As I mentioned, it's probably best to encode your application-specific information in response headers or bodies.
What is the issue?
The issue is that linkerd change the HTTP response status phrase. For example, my web application response code is
400 Only Managers Can Do This
, but linkerd response to this request is400 Bad Request
. And in the case of custom HTTP codes, they are all shown asnone
.How can it be reproduced?
Create a web application that returns a custom http response, inject linkerd and then call the API.
Logs, error output, etc
In my application, I have this API:
The response is:
But the returned response from linkerd is as follow:
output of
linkerd check -o short
Environment
Possible solution
No response
Additional context
No response
Would you like to work on fixing this bug?
No response