Configure IIS to pass-through CGI output without any conditioning
Posted
by
Daniel Watrous
on Server Fault
See other posts from Server Fault
or by Daniel Watrous
Published on 2011-02-11T20:38:39Z
Indexed on
2011/02/11
23:27 UTC
Read the original article
Hit count: 271
I'm building a web service on Windows 2008 R2 with IIS 7.5 and Python 2.5.
Right now I have the Handler Mappings and everything else setup just fine, Except that IIS is modifying what it gets back from the CGI script before sending it along the the client. Here's an example: I wrote the following CGI script:
# hello.py
print "Status: 400 Bad Request"
print "Content-Type: text/html"
print
print "Error Message"
According to the HTTP spec this should be fine and a Status of 400 should allow for a description of the error message in the body of the response.
When the server response actually comes back to me I get the following:
Status: 400 Bad Request
Date: Fri, 11 Feb 2011 17:58:30 GMT
X-Powered-By: ASP.NET
Connection: close
Content-Length: 11
Server: Microsoft-IIS/7.5
Content-Type: text/html
Bad Request
I've seen on this forum and others where I can change or eliminate the X-Powered-By header element, but I would like IIS to leave it alone altogether. I'm not sure why it takes my response, deletes "Error Message" from the body and replaces it with "Bad Request" and then adds all that other junk in.
Is there some way to tell IIS to just send the response along without making any changes at all?
© Server Fault or respective owner