David
Tue Feb 22 18:15:10 CST 2005
The pragmatic side of me suggests:
- Make sure it sends responses that have lines terminated with \r\n and not
only \r or \n (invalid according to HTTP spec)
- Make sure the response has a double \r\n terminating the response headers
(HTTP validity requirement)
- It also needs to return a Content-Type: header (else browser has no idea
what to do and may guess)
- The Location: value should be absolute-URI (according to HTTP spec)
Browsers and some web servers are extremely lax about HTTP specifications
and allow web page authors to get away with things (which is really bad
because that destroys the value of a specification like HTTP). IIS6 CGI
will complain about the first three. The latter, you should read section
14.30 of RFC2616 for followup details.
The academic inside of me suggests that you need to read CGI and HTTP
specifications on what is necessary on a proper HTTP 302 response (which is
what you are trying to generate here). Google should help here.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mike Swaim" <mswaim@odin.mdacc.tmc.edu> wrote in message
news:%23uwSa%23RGFHA.3376@TK2MSFTNGP12.phx.gbl...
I have a perl script that tries to do a redirect. It works fine with
IIS 5 and 5.1, but dies with 6, which complains
"The specified CGI application misbehaved by not returning a complete
set of HTTP headers."
The script returned
Status: 302 Moved
location: logon.pl?Retry=true
What else does it need to return? AFAIK, that's all that I can see it
needing to return after a couple hours of googling.
--
Mike Swaim swaim@hal-pc.org at home | Quote: "Boingie"^4 Y,W & D
MD Anderson Dept. of Biostatistics & Applied Mathematics
mpswaim@mdanderson.org or mswaim@odin.mdacc.tmc.edu at work
ICBM: 29.763N 95.363W|Disclaimer: Yeah, like I speak for MD Anderson.