简体   繁体   中英

How to prevent decoding of encoded forward slashes in Windows Live mail?

I've got aform with a continue link that is send by email. In this link I've added some sensitive encrypted data that is encoded by Base64 . The value contains a slash which is encoded into %2F (with a Server.UrlEncode ). When I send the link to a Windows Live address I see that Outlook.com decodes the %2F back into a forward slash. How can I prevent this?

I'm sending:
<a href="http://www.tempuri.com/key=RVQ%2FcGhvbmVfaG9tZSE%3D">Continue</a>

But I'm seeing:
<a href="http://www.tempuri.com/key=RVQ/cGhvbmVfaG9tZSE=%3D">Continue</a>

It can be reproduced by sending the link http://www.tempuri.com/key=RVQ%2FcGhvbmVfaG9tZSE%3D from any mail client to the Windows Live address.

You can try to encode the value twice.

So RVQ/cGhvbmVfaG9tZSE= is encoded as RVQ%2FcGhvbmVfaG9tZSE%3D --> this was your value.

Now encode this, and you get RVQ%252FcGhvbmVfaG9tZSE%253D --> the email client won't decode %252F to a slash so your problem is gone.

Just don't forget to decode the value twice ;-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM