Location headers and Status

Location headers and Status

Post by John Swe » Mon, 26 Aug 1996 04:00:00



If a CGI outputs a Location: header, what is the default Status returned
to the browser in Apache 1.1.1+, is it 302?  A while ago I had CGIs
dumping out Set-Cookie headers followed by Location headers, intending
a 302 Status, but not explicitly setting it, and what got sent instead
was a 200 and my Set-Cookie: headers were ignored. I hacked the server
quickly to change this, but is the default now 302? I tried a test script
on a plain version of Apache 1.1.1 and it worked and I got a 302.

If someone could clarify exactly I would much appreciate it.

Jeremey Barrett

 
 
 

Location headers and Status

Post by Alan J. Flavel » Mon, 26 Aug 1996 04:00:00



Quote:> If a CGI outputs a Location: header, what is the default Status returned
> to the browser in Apache 1.1.1+, is it 302?  

TELNET to the server's HTTP port and try it?

Read the CGI spec at http://hoohoo.ncsa.uiuc.edu/

Note the distinction between a Location that specified an absolute URL,
and one that specified a virtual path.  From what it says about the
second one, it will clearly send status 200.  The first one will be 30x
but it doesn't make clear whether 301 or 302 will be used, AFAIR.

Quote:> A while ago I had CGIs
> dumping out Set-Cookie headers followed by Location headers, intending
> a 302 Status, but not explicitly setting it, and what got sent instead
> was a 200 and my Set-Cookie: headers were ignored.

Do you suppose the cookies have anything to do with this?  Surely
the most elementary problem-solving technique would be to take them
away and see what difference it made, if any.

Quote:> I hacked the server
> quickly to change this, but is the default now 302?

You hacked the server, and now you ask _us_ what it will do: is
this reasonable?

 
 
 

Location headers and Status

Post by John Swe » Wed, 28 Aug 1996 04:00:00




:
: > If a CGI outputs a Location: header, what is the default Status returned
: > to the browser in Apache 1.1.1+, is it 302?  
:
: TELNET to the server's HTTP port and try it?

That's how I arrived at knowing that the status was 302 in Apache 1.1.1.

:
: Read the CGI spec at http://hoohoo.ncsa.uiuc.edu/
:
: Note the distinction between a Location that specified an absolute URL,
: and one that specified a virtual path.  From what it says about the
: second one, it will clearly send status 200.  The first one will be 30x
: but it doesn't make clear whether 301 or 302 will be used, AFAIR.

I'm talking about an absolute URL. Obviously an internal redirect would
not send Set-Cookie to the browser until the redirected-to script had
been run. The Set-Cookie does get sent after the execution of the
redirected-to script.

:
: > A while ago I had CGIs
: > dumping out Set-Cookie headers followed by Location headers, intending
: > a 302 Status, but not explicitly setting it, and what got sent instead
: > was a 200 and my Set-Cookie: headers were ignored.
:
: Do you suppose the cookies have anything to do with this?  Surely
: the most elementary problem-solving technique would be to take them
: away and see what difference it made, if any.

The Set-Cookie header had nothing to do with it. The fact that Location
was returned caused the Set-Cookie header (and anything else I might have
dumped out) to be ignored.

:
: > I hacked the server
: > quickly to change this, but is the default now 302?
:
: You hacked the server, and now you ask _us_ what it will do: is
: this reasonable?
:

You misunderstand, or I was not clear enough, or something... when I made
this change, it was to Apache 1.0.0 or so. My question is has the default
behavior changed since then (ie in Apache 1.1.1).

Jeremey Barrett

 
 
 

1. Headers, Headers, whos got the Headers

:   - Does anybody have any idea how the headers are supposed to be arranged
:     and what their contents should be?
:
:   - Which ones go where, which versions should be used, which ones shouldn't
:     be used, where can they be found?
:
:   - Should the headers included with the GNU 2.2.2 release in
:     0.96cpl2inc.tar.Z be used as well as those included with the 0.97
:     kernel? (I wasn't using them)
:
: Any help that anybody could give would be appreciated.  And "No!" I don't plan
: on quitting my day job. :)

I think H.J. and Linus finally have the header problem solved.  Get
2.2.2d when it's released tomorrow and install it with the 0.97pl1
kernel source.  After that, everything should work fine (at least it
does on my system).

David
--
David Engel                        Optical Data Systems, Inc.

(214) 234-6400                     Richardson, TX  75081

2. I want to know how fast my PLIP connection is.

3. location of iostream header file

4. Printing Postscript on PCL printer

5. Content-Location http header

6. HOW DO I GET IT TO TELL HOW MANY MESSAGES IN MAIL?

7. Apache 1.2b3 & Location response header

8. include files <sys/ipc.h> and <sys/shm.h>

9. NETSCAPE server,location header

10. linux headers location?

11. redirect (via Location: header) on netscape server

12. Help about the diff btw MIME's Content-ID and Content-Location header

13. Locations for Header Files?