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

301 issues with special characters #551

Open
AntoineLemaire opened this issue Oct 20, 2023 · 0 comments
Open

301 issues with special characters #551

AntoineLemaire opened this issue Oct 20, 2023 · 0 comments

Comments

@AntoineLemaire
Copy link

AntoineLemaire commented Oct 20, 2023

Hi everyone,

We installed @nuxtjs/pwa into our Nuxt2 project, and we have an issue when worker have cache on 301 redirections on URL with special characters, like ñ

On the same domain, I have 2 projects, some paths are opened with Nuxt, and some others in a PHP (Symfony) project. Everything is managed by nginx to use the right application.

In the PHP app, sometimes I'm doing some 301 redirects to URLs with a special character, example

header("Status: 301 Moved Permanently", false, 301);
header("Location: https://my-domain.org/niñera");
exit();

This URL is handled by Nuxt App. But since I've installed @nuxtjs/pwa, if worker has been loaded a first time, the redirection does not work, because it redirect to /niñera instead of /niñera (or the url-encoded version : /ni%C3%B1era)

Without Service-worker:
image

With Service-worker:
image

My config is pretty simple:

    pwa: {
        icon: false,
        meta: false,
        manifest: false,
        workbox: true,
        onesignal: false,
        offline: false,
    }

I also tried to set everything networkOnly

        workbox: {
            runtimeCaching: [
                {
                    urlPattern: ".*",
                    handler: "networkOnly",
                },
            ],
        }

But I don't understand what happen, and how to avoid that.

Does anyone have an idea how I can deal with those special characters in 301 redirect ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant