Forum Moderators: coopster & phranque

Message Too Old, No Replies

NPH on IIS?

(non parse header)

         

littleman

7:46 pm on Dec 15, 2001 (gmt 0)



Is it possible?

Xoc

8:11 pm on Dec 15, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Refresh my memory on what a Non-parsed header means.

Air

8:20 pm on Dec 15, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's a cgi script generating it's own HTTP headers instead of letting the server do it. CGI scripts that generate their own headers start with the prefix nph- i.e. nph-myscript.pl on *nix systems.

HTH you field the question for NT systems Xoc.

Xoc

8:52 pm on Dec 15, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my brief look through the IIS docs, I don't see any way to construct your own header. You can modify the header in a number of ways, but not construct a completely new one. Things you can do:

  • Change the status code using Response.Status.
  • Add a new header line using Response.AddHeader.
  • Change the character set using Response.CharSet.
  • Set the content type using Response.ContentType.
  • Set the expiration time using Response.Expires or Response.ExpiresAbsolute.
  • Change the cookies sent back using Response.Cookies.
  • Set the cache control using Response.CacheControl.
  • Output additional binary info using Response.BinaryWrite.

This may or may not let you do what you need. See [asp-help.com ] for some more info.

seriesint

9:36 pm on Dec 15, 2001 (gmt 0)



Found no mention of it in the MS Docs but this MSKB article mentions using nph- as a workaround for a bug with cookie handling.

[support.microsoft.com...]

Name it nph- and build the header as desired.

littleman

10:00 pm on Dec 15, 2001 (gmt 0)



Thanks for the clarification Air, and thanks for the research Xoc.

Seriesint, good find! It seems like a given that they would build nph capabilities into IIS, but I was beginning to wonder. ''

Actually, the question was mostly academic, I was digging around for a friend to explore option for how to avoid 304 errors... Or in other words, how it could stay "fresh!".;)

Xoc

12:26 am on Dec 16, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you just want to add header lines, you can do it through code, or through the IIS manager dialogs. An example of adding a header line through code would be:

Call Response.AddHeader("P3P", "policyref=""/w3c/p3p.xml""")

This tells IE6 where to find your P3P privacy policy.

Another example...ASP pages never send the Last-Modified header (I believe that .htm and .html pages do). So if you want to send the Last-Modifed header as being the date and time the page was requested:


Call Response.AddHeader("Last-Modified", RFC1123Date(Now))

where RFC1123Date is defined as:

Function RFC1123Date(dateSpec)
Dim astrDay
Dim astrNum
Dim astrMonth

astrDay = Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
astrNum = Array( "00", _
"01", "02", "03", "04", "05", "06", "07", "08", "09", "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", "47", "48", "49", "50", _
"51", "52", "53", "54", "55", "56", "57", "58", "59", "60")
astrMonth = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", _
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
RFC1123Date = astrDay(WeekDay(dateSpec) - 1) & ", " & astrNum(Day(dateSpec)) _
& " " & astrMonth(Month(dateSpec) - 1) & " " & Year(dateSpec) _
& " " & astrNum(Hour(dateSpec)) & ":" & astrNum(Minute(dateSpec)) _
& ":" & astrNum(Second(dateSpec)) & " " & Application("TimeZone")
End Function


and Application("TimeZone") is defined using:

Application("TimeZone") = "-0800"'From RFC0822