Skip to content
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

PWA doesn't encode URI components correctly. #1640

Closed
Thomas-Bergmann opened this issue Apr 23, 2024 · 0 comments · Fixed by #1641
Closed

PWA doesn't encode URI components correctly. #1640

Thomas-Bergmann opened this issue Apr 23, 2024 · 0 comments · Fixed by #1641
Assignees
Milestone

Comments

@Thomas-Bergmann
Copy link
Contributor

Thomas-Bergmann commented Apr 23, 2024

Actual Behavior
Mostly the PWA doesn't encode URI components. Only at the "login" is encoded twice. (That's a result of the wrong decoding in ICM)
As result products objects with IDs containing "/" slashes or "%2F" percentage character using a wrong encoding.

for example a product-sku with "a/product%2023" leads to a wrong URI ".../products/a/product".

Expected Behavior

Every URI component, which isn't a constant needs to be encoded with "encodeURIComponent" once.

Steps to Reproduce the Bug

Steps to reproduce the behavior:

  1. Go to backoffice and create a product with id "a/product%2023"
  2. Go to "QuickOrder and enter the product with sku "a/product%2023"
  3. See error in network request.

Environment Details

  • Desktop: *

    • OS: Ubuntu
    • Browser: Chrome
    • Project Code Version: PWA 5.1.0, ICM 11.10.0

Additional Context, like Screenshots, Log File Snippets etc.

AB#96080

@Thomas-Bergmann Thomas-Bergmann self-assigned this Apr 23, 2024
Thomas-Bergmann added a commit that referenced this issue Apr 23, 2024
* only constants doesn't need to be encoded
Thomas-Bergmann added a commit that referenced this issue Apr 24, 2024
* only constants doesn't need to be encoded

The URI component will be done by encodeResourceID.
In case ICM is fixed the project can change it to single encoding at one place.
@Thomas-Bergmann Thomas-Bergmann changed the title PWA doesn't encode URI components correctly. WIP: PWA doesn't encode URI components correctly. Apr 24, 2024
@Thomas-Bergmann Thomas-Bergmann changed the title WIP: PWA doesn't encode URI components correctly. PWA doesn't encode URI components correctly. Apr 24, 2024
Thomas-Bergmann added a commit that referenced this issue Apr 25, 2024
* using encodeResourceID in the tests too allows a single switch at that function.
@shauke shauke added this to the 5.2 milestone May 3, 2024
shauke pushed a commit that referenced this issue May 3, 2024
* only constants doesn't need to be encoded

The URI component will be done by encodeResourceID.
In case ICM is fixed the project can change it to single encoding at one place.
shauke pushed a commit that referenced this issue May 3, 2024
* using encodeResourceID in the tests too allows a single switch at that function.
shauke pushed a commit that referenced this issue May 3, 2024
* encode all URI components with encodeResourceID function
* only constants doesn't need to be encoded
* in case ICM is fixed (ICM 12) the project can change it to single encoding at one place
* plus sign must not be encoded plus comment why plus sign must not be encoded
* migration note for encodeResourceID and ICM 11 vs ICM 12 handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants