Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
326 stars 56 forks source link

Route redirect url encoding #1200

Open Xriuk opened 1 year ago

Xriuk commented 1 year ago

staticwebapp.config.json

{
    "routes": [
        {
            "route": "/tiktok",
            "redirect": "https://www.tiktok.com/@myuser",
            "statusCode": 301
        }
}

When navigating to https://myapp.com/tiktok redirects to https://www.tiktok.com/%40myuser

According to RCF 3986 the @ sign is a valid url component and should not be encoded

Also more generally speaking I agree with what was said in #1007

the service should not be URL encoding what we enter for redirect values without us explicitly telling it to. In other words, our redirect URLs should function exactly as we have written them.

matkoch commented 1 year ago

@annikel you closed my previous issue (#1007) without any further clarification.

Meanwhile, it's clear that an RCF supports what was already my gut feeling. Good job @Xriuk, btw!

Could you please address this now?