How do I have to escape ampersands in URLs when lo

2019-07-04 11:16发布

问题:

Well actually I know, that I should replace & by %26

But I'm using this URL to log in with OpenID:

https://innubili-gidea.appspot.com/_ah/login_redir?claimid=https://www.google.com/accounts/o8/site-xrds?hd=icada.com&continue=https://innubili-gidea.appspot.com/%3Fdomain%3Dicada.com%26campaign%3D2%26

As you can see, the continue parameter is properly escaped.

But after being redirected through Googles login pages, it redirects me back to

https://innubili-gidea.appspot.com/?domain=icada.com

So the &campaign=2 parameter is missing

Can you confirm, that I escaped the continue parameter correctly?

For then it looks to me as this seems to be an issue at Googles login.

回答1:

You are correctly escaping the Url, and yes, this is a well-known issue.



回答2:

I just found out it works, if I escape the ampersand twice.

& -> %26 -> %2526