Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Request.Url.GetLeftPart(UriPartial.Authority) - strange results

Reply
 
Old 08-19-2008   #1 (permalink)
TimW


 
 

Request.Url.GetLeftPart(UriPartial.Authority) - strange results

I'm having a problem on an ASP.NET 1.1 web site. The page where I'm having
a problem is accessed without SSL. It contains a link to another page which
can be configured to require SSL. If SSL is required, I change the URL of
the link from a relative URL to an absolute URL with HTTPS something like
this:

string newUrl =
Request.Url.GetLeftPart(UriPartial.Authority).Replace("http://","https://")
+ Response.ApplyAppPathModifier("/MyApp/Secure/MyPage2.aspx");

The GetLeftPart(UriPartial.Authority) is returning a completely different
domain name from the domain in the request:

The Request address is like http://www.MyCompany.org/MyApp/Page1.aspx.

The GetLeftPart expression is returning something like:

https://www.MyCompanysOtherSite.org/...ure/Page2.aspx.

If I enabling Trace for the www.MyCompany.org site, the trace information
says the server variable SERVER_NAME is www.MyCompanysOtherSite.org . There
is no reference in the application whatsoever to MyCompaniesOtherSite.org.

So it appears to me that there's something incorrect in the setup of the
MyCompany.org site, but this is beyond my expertise to explain or fix.

How does GetLeftPart(UriPartial.Authority) work, is it the wrong concept
here, what's happening?

Tim W.





My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Strange request Virtual PC
not enough authority Vista account administration
Strange Vista Benchmark Results Vista General
Help, Vista says I don't have Authority! Vista General
Strange dir d*. results Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46