Questions tagged [request.servervariables]

Questions regarding ASP ServerVariables Collection

45 questions
1
vote
3 answers

ASP.NET - Telling the difference between localhost and 127.0.0.1

How can you tell the difference between a request going to 127.0.0.1 and localhost. This line of code on Windows 7 and VS2010 built-in web server can not tell the difference. if (Request.ServerVariables["SERVER_NAME"].ToLower() ==…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
1
vote
1 answer

Javascript to preserve \f in returned value

I have the following javascript which works fine for the most part. It gets the user that has logged in to the site and returns their DOMAIN\username info. The problem arises when the username starts with a letter that completes a valid escape…
0
votes
1 answer

ServerVariables["UNENCODED_URL"] is empty when I try to access it in my MVC Action

I'm writing a catch-all action method for a 404 page that takes the requested URL, extracts the wordy bits with a regex (\w+)* and sends those bits, space-separated, to the search engine to generate a list of suggested pages. The problem is,…
Faust
  • 15,130
  • 9
  • 54
  • 111
0
votes
0 answers

Blazor Server App - How to loop through request server variables

In classic ASP, the way to loop through all request's server variables was like this: for each x in Request.ServerVariables response.write(x & " = " & Request.ServerVariables(x) & "
") next To get an individual variable such as…
Andres
  • 192
  • 1
  • 14
0
votes
1 answer

Why IIS Server returns null baseUrl of ASP.NET CORE 5 MVC project, but returns true on local server?

I am developing ASP.NET CORE 5 MVC project and I want to use server variables to send email and show the file on new tab. In my local machine I can get the host name but after publishing on IIS, I couldn't get the result. I am getting base url like…
0
votes
1 answer

When I use Request.ServerVariables("CERT_SUBJECT"), what does the value C=US mean?

When I use Request.ServerVariables("CERT_SUBJECT") I end up getting something like this as a string: C=US, O=XXX, OU=XXX, OU=XXX, OU=XXX, CN=DOE.JOHN.JACOB.9999999 what does the value C=US mean? is this the cardholder's citizenship? The country of…
0
votes
0 answers

Request.ServerVariables.Keys returns empty

I am trying to write a simple .asp file that displays all of the keys and values from Request.ServerVariables, and, somehow, I am not able to find anything within Reuqest.ServerVariables. This is my test.asp: <%@ language="Javascript" %>