We noticed that several machines have problems with URLs with hash parameters.
When debugging a request with the URL:
http://domain.com/Entity(%23{number-here}
We see in the Application_BeginRequest
method in the global.asax
file the URL:
http://domain.com/Entity(#23{number-here}
in Url.OriginalString
and the Url.LocalPath
has http://domain.com/Entity(
and all the chars after the hash are in Url.Fragment
.
When running exactly the same application on machines running Windows 8.1 and IIS 8.5 it works as expected, the Url.OrinalString
is http://domain.com/Entity(%23{number-here}
.
I can’t see anything suspisous in the URL rewrite section in the web.config
or in the IIS configuration.
What can be the reason for this behaviour?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
This is a bug in System.Web.dll. It is fixed on Windows 8.1, but we haven’t yet rolled out a fix to System.Web.dll on downlevel versions of the operating system. We’re trying to get a fix in for .NET 4.5.x for all supported OSes when the next reliability update comes out.
Method 2
Here’s a workaround for older OS’s until the bug fix is ported back. If you have the luxury of changing the URL, put the term that may contain a hash in a query string parameter, e.g.
http://domain.com/?entity=Entity(#23{number-here}
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0