-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url encoded characters get decoded #343
Comments
+1 |
+1 Having same issue in Azure. I'm passing an encoded path in the URL and it is being decoded and not matching on the appropriate route. |
There was an older issue about that, I commented the problem there. Still found no solution to it: |
For now I was able to promote UNENCODED_URL IIS rewrite module server variable to headers, and at least I have it in node app. I'm going to see where request url gets created and passed to nodejs app in iisnode source code |
@eugeneagafonov Did you have any luck with this? :) |
Hi I am experiencing the same problem. I am requesting something like /search/old%2F1 and node gets the request /search/old/1 . In my case I have this issue on Azure and a Windows 7 / IIS box. Any help greatly appreciated. |
Hi everyone, @joaosa @BorisJanischevsky you can follow the link to my pull request, and if you manually compile and build installers for iisnode, it will fix the issue: It could be easier if you go to my fork and try VS2015 solution here: |
change to match the corresponding server change deployed a couple days back. Here are details of the issue: // IIS and Azure web apps have this annoying behavior where %2F (URL encoded slashes) in the URL are URL decoded // BEFORE the requests reach node. That essentially means there's no good way to encode a "/" in the app name-- // URL encodeing will work when running locally but when running on Azure it gets decoded before express sees it, // so app names with slashes don't get routed properly. See tjanczuk/iisnode#343 (or other sites // that complain about the same) for some more info. I explored some IIS config based workarounds, but the previous // link seems to say they won't work, so I eventually gave up on that. // Anyway, to workaround this issue, we now allow the client to encode / characters as ~~ (two tildes, URL encoded). // The CLI now converts / to ~~ if / appears in an app name, before passing that as part of the URL. This code below // does the encoding. It's hack, but seems like the least bad option here. // Eventually, this service will go away & we'll all be on Max's new service. That's hosted in docker, no more IIS, // so this issue should go away then.
#471) change to match the corresponding server change deployed a couple days back. Here are details of the issue: // IIS and Azure web apps have this annoying behavior where %2F (URL encoded slashes) in the URL are URL decoded // BEFORE the requests reach node. That essentially means there's no good way to encode a "/" in the app name-- // URL encodeing will work when running locally but when running on Azure it gets decoded before express sees it, // so app names with slashes don't get routed properly. See tjanczuk/iisnode#343 (or other sites // that complain about the same) for some more info. I explored some IIS config based workarounds, but the previous // link seems to say they won't work, so I eventually gave up on that. // Anyway, to workaround this issue, we now allow the client to encode / characters as ~~ (two tildes, URL encoded). // The CLI now converts / to ~~ if / appears in an app name, before passing that as part of the URL. This code below // does the encoding. It's hack, but seems like the least bad option here. // Eventually, this service will go away & we'll all be on Max's new service. That's hosted in docker, no more IIS, // so this issue should go away then.
are there any updates on that? |
a workaround i used is to decode the url again before it gets to the router of nodejs:
but i would strongly prefer to not hack like this... |
@vzaidman you can build and use the modified version. As far as I understand there are no plans to accept pull requests from this repo. You can try to mention this issue in azure iisnode repo |
Experiencing the same issue, any updates on this? |
for me, an Azure web app is not decoding "%3F" (?) in URL like this: We are running a Linux image in a Linux container. Any solution? Else we can't migrate to Azure as other calling apps will break. |
No solution for Azure because this is handled before your app. This is considered as a security issue. Please follow this to check: #217 (comment) One thing I suggest to try is a container app instead of web app (though It might be pretty much the same), or azure container instances, or any other hosting that might not have built-in load balancer. Probably AKS or Service Fabric. If it's just one container and these options are too much overkill, try hosting this on a usual VM. |
I have a problem with iisnode on Azure which is that the url encoded entities when passed to my express app in node are already decoded and can cause problems with the routing.
It doesn't seem to happen for all characters, for example %20 remains encoded while %3D gets decoded.
The text was updated successfully, but these errors were encountered: