You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/14 13:34:57 UTC

[GitHub] [pulsar] RobertIndie commented on a change in pull request #14677: Fixed 404 error msg not being returned correctly using http lookup.

RobertIndie commented on a change in pull request #14677:
URL: https://github.com/apache/pulsar/pull/14677#discussion_r825946081



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/web/RestException.java
##########
@@ -49,7 +49,11 @@ public RestException(Response.Status status, String message) {
     }
 
     public RestException(int code, String message) {
-        super(message, Response.status(code).entity(new ErrorData(message)).type(MediaType.APPLICATION_JSON).build());
+        super(message, Response
+                .status(code, message)

Review comment:
       According to the [RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-6.1.1), the `Reason Phrase` here is intended to give a short textual description of the Status-Code. We'd better not set it up with our custom message. Instead, we could fix this issue by getting the response error message rather than the status text(reason phrase) in the `HttpClient`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org