Closed plemarquand closed 9 years ago
Glad it worked, Paul. Could you also provide a unit test for this?
@sophokles73 I can't find any existing tests for californium-proxy. Should I create a test/ directory under the californium-proxy project or are there functional tests somewhere I'm not seeing?
Seems like you have found the heel of Achilles of Californium Proxy ;-) We are always lacking unit tests, so feel free to add the corresponding folder and create the first test case :-)
@sophokles73 The new patch in the request adds 2 tests that validate the original patch. Luckily Maven was already configured to run tests in the project so it was more straightforward than I thought it'd be.
@plemarquand,
the test case currently lacks the eclipse copyright header. Simply copy the header from another file and make sure to update the copyright year to include 2015 and add your name along with a little comment what you fixed at the bottom of the header.
@sophokles73 Eclipse header added, I've amended the commit.
@sophokles73 Addressed newline comment
@sophokles73 Additional patch cleans up the commented code and adds me as a contributor to the file.
Thanks @plemarquand :-)
I have squashed all three commits into one and merged to master ...
@sophokles73 Thanks!
My pleasure! Hope we'll see some more patches/contributions from you .. :-)
When translating HTTP requests in the proxy, if the contentType was created via ContentType.parse the charset of the translated request would always be modified to be ISO_8859_1 even if the content type was application/json. The newly created content type was compared to the existing static instance using object equality instead of .equals().
Fixes the issue by comparing mime types directly.