JsonMapObjectReaderWriter not escaping the characters like \n properly#900
Open
juniiorviani wants to merge 2 commits intoapache:mainfrom
Open
JsonMapObjectReaderWriter not escaping the characters like \n properly#900juniiorviani wants to merge 2 commits intoapache:mainfrom
juniiorviani wants to merge 2 commits intoapache:mainfrom
Conversation
- the strings is now properly escaped
amarkevich
reviewed
Feb 6, 2022
...ions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
Outdated
Show resolved
Hide resolved
Contributor
|
@juniiorviani could you add a unit test for this case? |
amarkevich
reviewed
Feb 6, 2022
...ions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
Show resolved
Hide resolved
Author
|
Sure thing, @amarkevich I just added the unit tests |
Contributor
|
The tests are failing in this module, and checkstyle as well: [ERROR] Failures: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue ref: https://issues.apache.org/jira/browse/CXF-8651
The JWS is generate with an invalid payload if I try to set a claim like this:
JwtClaims claims = new JwtClaims();
String claim = "GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8";
claims.setClaim("test", claim);
JwsCompactProducer jwsProducer = new JwsJwtCompactProducer(claims);
The JWS payload result will be: eyJ0ZXN0IjoiR0VUCgoKV2VkLCAxOSBKYW4gMjAyMiAxNToyNToyOSBHTVQKL3Rlc3QvMTZjOGExZWMtOGQ3NS00N2ExLWIxMzgtNDY3NDY3MTNiOGQ4In0
And when I decode the result is:
"{"test":"GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8"}"
This is an invalid payload because the json is stringify.. the json should be:
{ "test" : "GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8" }