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

fix: trailing '/' in path results to a wrong multi channel configuration #1553

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

shauke
Copy link
Collaborator

@shauke shauke commented Dec 11, 2023

PR Type

[x] Bugfix

What Is the Current Behavior?

http://localhost:4200/b2c/home
compared to
http://localhost:4200/b2c/home/
results in different storefronts even though the result should be the same

This problem is reproducible with the standard PWA with the following multi channel configuration with a docker compose deployed NGING + SSR container:

      MULTI_CHANNEL: |
        .+:
          - baseHref: /b2c
            channel: inSPIRED-inTRONICS-Site
            theme: b2b
          - baseHref: /b2b
            channel: inSPIRED-inTRONICS_Business-Site
            theme: b2b

Using the wrong channel when working with a trailing / is the actual problem. The used themes configured channel of the environment.b2b.ts is used instead of the one configured in the multi channel configuration of the deployment.
The problem occurs with any path after adding a trailing /.

What Is the New Behavior?

An additional rewrite rule for NGINX - rewrite ^(.*)/$ $1; - removes a trailing slash before handling the route to the SSR container.

Does this PR Introduce a Breaking Change?

[x] No

Other Information

AB#92017

@shauke shauke added this to the 5.0 milestone Dec 11, 2023
@shauke shauke self-assigned this Dec 11, 2023
@shauke shauke added the bug Something isn't working label Dec 11, 2023
@shauke shauke merged commit c500625 into develop Dec 12, 2023
25 checks passed
@shauke shauke deleted the bugfix/trailing_slash_routes branch December 12, 2023 16:59
shauke added a commit that referenced this pull request Mar 5, 2024
* addresses issues with trailing slashes for MULTI_CHANNEL configurations without 'baseHref' (introduced with #1553)
* fix "the rewritten URI has a zero length" error in nginx multi channel handling
* prevents canonical links with doubled "/"(slash) between the domain name and the rest of the path
shauke added a commit that referenced this pull request Mar 6, 2024
…#1566)

* addresses issues with trailing slashes for MULTI_CHANNEL configurations without 'baseHref' (introduced with #1553)
* fix "the rewritten URI has a zero length" error in nginx multi channel handling
* prevents canonical links with doubled "/"(slash) between the domain name and the rest of the path
shauke added a commit that referenced this pull request Mar 7, 2024
…#1566)

* addresses issues with trailing slashes for MULTI_CHANNEL configurations without 'baseHref' (introduced with #1553)
* fix "the rewritten URI has a zero length" error in nginx multi channel handling
* prevents canonical links with doubled "/"(slash) between the domain name and the rest of the path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants