I've created an Azure C# HTTP triggered function with a route url: subscriptions/{token}/t
. It works fine for urls such as subscriptions/blah/t
but it fails with a 404
for parameters that contain encoded slashes: subscriptions/blah%2fblah/t
. Any way around this ?
Before we get into debates, {token}
is a URL encoded Base64 string which will naturally contain slashes.
This issue seems to persist. I found out that it can be resolved by double-escaping the string, that is, applying escaping recursively two times.
token = escape(escape(token));
In .NET you can use URI.EsacpeDataString()
In JS you can use encodeURIComponent()
Note, that single escaping does not work reliably with Azure functions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With