umbraco / Umbraco.Commerce.PaymentProviders.Stripe

MIT License
1 stars 2 forks source link

Continue URL redirects to root URL if it doesn't include a trailing slash #6

Open MMasey opened 4 months ago

MMasey commented 4 months ago

I'm not sure if this is a documentation issue or an actual bug, but if you have a Continue URL without a trailing slash, when the Payment Provider tried to redirect to the correct URL, it end up going to the root URL /.

My site is configured to remove trailing slashes, so I didn't include them in my configuration, but when adding them back in, it worked as expected. E.g.

If the trailing slash is a functional requirement, this should be explained in the docs and the property descriptions. Whilst the example urls in the description do include a trailing slash, it isn't obvious that they are required (if they are)

mattbrailsford commented 4 months ago

I'm pretty sure these aren't required. Have you tried disabling your other rewrites to see if anything is conflicting?

MMasey commented 4 months ago

Heyo, yeah turns out it was the redirects 😅 That being said, I'll put in a PR to the docs just to add a line for those fields saying that if you're taking the no trailing slash approach they still need to be present.

MMasey commented 4 months ago

Docs PR for reference - https://github.com/umbraco/UmbracoDocs/pull/6197

It likely needs a bit of tweaking

mattbrailsford commented 4 months ago

I don't understand what causes the redirect to '/' though? UC should just be redirecting to whatever URL is provided so what is causing the redirect to be ignored?

MMasey commented 4 months ago

Yeah I don't know why it's happening either. I'll need to find sometime to pull down the repo and properly debug it. Maybe it's got something to do with routing?

mattbrailsford commented 4 months ago

If you completely disable URL rewriting rules, does this continue to be the issue? I'm just surprised that hasn't been picked up before 🤔

MMasey commented 4 months ago

I think I need to find some time to set up a clean install and see if I can replicate the issue that way. It does feel really odd though that it works when the redirect is in place and I include the trailing slash. It's almost as if somewhere in the pipeline, it's doing an exact string comparison when searching for the url, and if it can't find it, it then redirects to / instead. That is purely a guess through based on how it's behaving.