Get Original Url

C

comphilip

I make a request with the address:
http://localhost/admin/administrator/new

Tracing the request with fiddler2, the URL of Request-Line of http message
is remain the same: /admin/adminstrator%2fnew.

But the value is change while accessing
HttpContext.Current.Request.Url.ToString(), it becomes
http://localhost/admin/adminstrator/new, "%2f" is automatically being
unescaped to "/". administrator%2fnew is a separated segment, but ASP.NET
make it two segments: administrator and new.

I try several way to get the original url:

HttpContext.Current.Request.Url.OriginalString
HttpContext.Current.Request.RawUrl
HttpContext.Current.Request.ServerVariables["URL"]

all fail.

How can I get the original url without any automatically unescaping?
 
C

comphilip

The environment of my computer is:
Windows XP + sp3
..NET 2.0

One more thing. Several months before I developed a similar web site on
vista + iis7 + asp.net 3.5. The url gotten from
HttpContext.Current.Request.Url.ToString() was not unescaped. The
percent-encoding was remained.

I don't ware why there are two different behaviors. Does it rely on IIS or
ASP.NET?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top