[Plus symbol issue] - UserAuthenticationTokenService sends requests with 'Content-Type' - 'application/x-www-form-urlencoded'
See original GitHub issueIf a user login or password contains a symbol +
it would be replaced with whitespaces 'cause Content-Type
is equal to application/x-www-form-urlencoded
. As a result, we have problems with users authorization.
Environment Details
- Spartacus: 1.0.4
Steps to Reproduce
- Go to the login page
- Type a login
- Type a password which contains a plus or pluses (e.g. 12345+qq)
Observed Results
All pluses would be replaced with whitespaces when we send form data.
Expected Results
Login and password are sent without changes.
Additional Information
As I can see UserAuthenticationTokenService sends requests with ‘Content-Type’ - ‘application/x-www-form-urlencoded’, Probably a problem is here.
https://spartacus-storefront.slack.com/archives/CD16V16FR/p1566915251244300
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Http Post request with content type application/x-www-form ...
The problem is that when we use application/x-www-form-urlencoded, Spring doesn't understand it as a RequestBody. So, if we want to use this we...
Read more >Solved: Interactive API Docs / POST body data omitted usin...
The problem lies within the Swagger spec you have. Body parameters can't really be used ... Content-Type: application/x-www-form-urlencoded
Read more >configure mule to post application/x-www-form-urlencoded ...
Hi. I want to call a rest service with POST method. This service takes application/x-www-form-urlencoded as Content-Type. It also takes some more values...
Read more >How to invoke target-url / api with x-www-form-urlencoded ...
Failed to parse 'request.body' as content type 'application/json;charset=UTF-8'. My initial API Gateway script to test this is:.
Read more >Solved: application/x-www-form-urlencoded content type err...
The problem with the webhook is that it sends the payload with a content type of. ... content type error using when a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @meeque for chiming in on this topic. Angular indeed doesn’t support clean encoding/decoding, which is why we do not get proper encoding for various characters (
@:$,;+=?/
). I’ve gone through various resources related to this topic, and I’m not sure why these characters are skipped.We should allow for proper encoding, but not without an option to customise this. My recommendation is to:
HttpParameterCodec
that solely uses theencodeURIComponent
anddecodeURIComponent
from the browserare there any news?