Mailing List Archive

httpd patch B18 updated.
Patch : B18
Submitter :
Sumary : Status: 302 should work, and doesn't
Version :
State : received
Priority : 3
Keywords : redirect, status, DIE
Have Code : Yes
Conflicts :

If a script returns Location:, the special CGI handling
for Location: is invoked even if it returned Status: ---
this makes it impossible to write a script which fakes up
a full redirect (including body text).

--- cliffs on Fri Mar 10 04:13:03 PST 1995 ---

Do you have code for this?

--- cliffs on Fri Mar 10 12;35;03 PST 1995 ---

Rob Hartill posted a patch for this to the list.

--- cliffs on Fri Mar 10 12:44:30 PST 1995 ---
I was just looking at my patch for "302" redirects - what it
doesn't do is add a body to the header to say

"This URL has moved to <A HREF="...">somewhere else</A>

on behalf of dumb clients.

I suspect this is why Rob McCool decided to thump all
redirects and treat them special with a die(REDIRECT).

Decission time - should redirect scripts be responsible for their
own body, and choose to add or omit one, and have the server leave
it all up to the script, or

should httpd add a body if there isn't one - as it does now, but
overwrite any body produced by the script, or

should httpd look for a body, add one if there isn't one.

The last option sounds the most reasonable, but will need some
additional coding.

I think we'd need to change "send_fd" from being a void function
to one returning the number of bytes (long) sent. If it returns
0, then we send the redirect blurb...

so in
http_script.c cgi_stub() & exec_post_NCSA() exec_get_NCSA()
the line


would change to

if (!send_fd(?,??,kill_children) && location[0]) {
title_html(??,"Document moved");
fprintf(??,"This document has moved <A HREF=\"%s\">here</A>.<P>%c",er


--- robh on Wed Mar 15 09;07;56 PST 1995 ---

Patch B18 has been uploaded and solves all the problems