Fixes unexpected error when request using pulsar 2.4.2 proxy - #157
Conversation
--- *Motivation* When sending a GET or DELETE request to the Pulsar proxy, the server always threw an IllegalArgumentException. By my test that's because we are setting the Content-Type for a request without the request body. We remove the Content-Type if the request is GET or DELETE. *Modifications* - Remove the header Content-Type for the GET and DELETE requests
|
@sijie |
|
@zymap : if apache/pulsar#5361 is the root cause, shouldn't we look into that issue? Why do you think removing |
|
@sijie Yes. we should. I look into the issue, the Also, I find the https://tools.ietf.org/html/rfc7231#section-3.1.1.5, |
Why it is -1? Is -1 the right value?
if that's the case, your fix is incorrect, no? If as what you said, wee should add content type based on whether we have content or not. but you are fixing based on the request type. why do you think a delete request will not have content? |
|
-1 is a default value in Jetty. In Pulsarctl the content length is 0.
Ah. You are right, I should add content-type based on whether we have content or not. |
|
@sijie PTAL. Thanks. |
…ative/pulsarctl#157) *Motivation* When sending a GET or DELETE request to the Pulsar proxy, the server always threw an IllegalArgumentException. By my test that's because we are setting the Content-Type for a request without the request body. We remove the Content-Type if the request is GET or DELETE. *Modifications* - Remove the header Content-Type if the content body is empty.
…ative/pulsarctl#157) *Motivation* When sending a GET or DELETE request to the Pulsar proxy, the server always threw an IllegalArgumentException. By my test that's because we are setting the Content-Type for a request without the request body. We remove the Content-Type if the request is GET or DELETE. *Modifications* - Remove the header Content-Type if the content body is empty.
Motivation
When sending a GET or DELETE request to the Pulsar proxy, the server
always threw an IllegalArgumentException. By my test that's because
we are setting the Content-Type for a request without the request body.
We remove the Content-Type if the request is GET or DELETE.
Modifications