-
Notifications
You must be signed in to change notification settings - Fork 361
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
Always a 5.02 response in ProxyHttpClientResource if http response contains no content-type header #2252
Comments
I guess the culprit is CrossProtocolTranslator.setCoapPayload() . If the "empty http content" is an empty array, then the check must be
Not sure, are you able to test that, if it fixes your issue? |
Maybe it's ContentTypedEntity, at least the error message indicates that. Then a fix may be:
(I'm currently too busy with other stuff. I'm not sure, if I find some time before July to really work on this. Afterward I will add some unit tests and try to reproduce and fix that bug.) |
It most definitely is the ContentTypedEntity. I went through it with the debugger and got this stacktrace:
I hope that is helpful for you. I don't think such a simple null check is enough to fix it, as you're going to have to introduce extra null checks on other places, where you now don't check the content type for null. Although I don't think you're going to be able to prevent that. Thanks for your quick response and take your time :) Bram |
It's "just tracking the usage" ;-). For now I see two places, where the content type is used and need to be checked. One will not be "called", because the payload is null and the other pass it to the http headers and is easy to fix. And one usage in Edited: empty payload may be just an null as producer. So, I think, it requires some tests with empty contents in several cases to see if it works. |
is provided as well. Fix issue eclipse-californium#2252 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Still just a "try & error". |
Awesome thanks for your quick help. I'm running it in maven currently, so would be a bit hard for me to checkout the pr-branch and build it from source. |
I switched the 3.13.0-SNAPSHOT build to use the branch "issue_2252". |
is provided as well. Fix issue #2252 Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Any result with the PR on the SNAPSHOT from your side? |
I'll check it out Tuesday, I don't have access to my laptop before that. I'll let you know then.On 28 Jun 2024 10:34, Achim Kraus ***@***.***> wrote:
@basimons
Any result with the PR on the SNAPSHOT from your side?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I can confirm, I ran all my tests, some of which failed with version 3.12, but now they all pass in version 3.13-SNAPSHOT. |
Fixes issue #2252. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
With some tests: I prepared an alternative fix in PR #2257 without introducing an API change. It's included in the current SNAPSHOT. |
Sure, I'll test it again tomorrow!
|
I ran the tests again, and they still pass fine! |
Add test and examples without payload. Fixes issue #2252. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Add test and examples without payload. Fixes issue #2252. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Add test and examples without payload. Fixes issue #2252. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
Bugfix release 3.12.1 is available. |
Hello,
After updating from californium 2.7.0 -> 3.12, I ran into a small issue.
I have a resource like this:
This worked fine in 2.7.0, but after upgrading I sometimes encounter an issue. This is caused when the server that the
ProxyHttpClientResource
does a request to, returns a response WITHOUT a content-type header, the response will always be a 5.02, with the message being "content type must not be null", which is set on org.eclipse.californium.proxy2.http.ContentTypedEntity#49.IMO this is a bug, because getting a response without a Content-Type header is fine as long as the Content-Length is also 0.
Kind regards,
Bram
The text was updated successfully, but these errors were encountered: