Redirect Url isn't encoded correctly

I think I may have discovered an issue with the way the automatic “login redirect” works in Litium. If you’ve named the templates correctly, if a user tries to navigate to a page she doesn’t have access to, she is automatically redirected to the login with a RedirectUrl-parameter.

The problem I am seeing that if the link contains a # the Redirect isn’t encoded correctly. Example navigating to:

/a-page#with-anchor

The login url and RedirectUrl-parameter becomes

/login?RedirectUrl=%2fa-page#with-anchor

But it should have become

/login?RedirectUrl=%2fa-page%23with-anchor.

It fails to encode the # which effectively makes it disappear.

Can I hook into this somewhere to fix it?

Litium version: 6.3.7

It seems #with-anchor (the fragment) is never sent in the request to the server. It’s used only client-side for the browser.

That is true! I just figured that it would be possible to find somewhere deep in the request, since it is included in the redirect, but you’re right, it’s the browser that transfers it…

yeah, this was a stupid question since I already knew that :man_facepalming: … but that behavior is also browser specific so I can’t really trust it to always be transferred if checking client side either.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.