Quote:>I have a script that worked fine under Apache, and CERN. It ends by
>generating a location header to a generated document. I was just using
>the virtual path to the document. Under the enterprise server - I get
>both the document, correctly typed, and at the end of the document an
>error message from the server - Error 400 Your browser has sent this
>server a request it does not understand.
>The errors log file file says:
> handle-request reports:
> method without URI
>If I send this location header with a complete url, so that it makes the
>round trip to the client, I do not get this error. What gives?
As I understand it, the Netscape Commerce Server should be converting the
relative URLs to absolutes before sending them. But ideally your script
should be supplying it, too. I'd say change your script, email a bug
report to Netscape, and don't hold your breath waiting for them to fix it
the server. Also make sure you are sending the redirection in response to
a GET, not a POST. I'm not sure if this answers your question or not..?
From the Common Gateway Interface IETF draft 1.1 (expired Aug 96, but
most likely still relevant):
9. Data output from the CGI script
There must be a system defined method for the script to send data
back to the server or client; a script will always return some data.
Unless defined otherwise, this will be via the `standard output' file
descriptor.
There are two forms of output that the script can give; non-parsed
header (NPH) output, and parsed header output. A server is only
required to support the latter; distinguishing between the two types
of output (or scripts) is implementation defined.
9.1. Non-Parsed Header Output
The script must return a complete HTTP response message, as described
in Section 6 of the HTTP specification [3]. Note that this allows an
HTTP/0.9 response to an HTTP/1.0 request.
The server should attempt to ensure that the script output is sent
directly to the client, with minimal buffering.
9.2. Parsed Header Output
The script returns a CGI response message.
CGI-Response = *( CGI-Header | HTTP-Header ) NL [ Entity-Body ]
CGI-Header = Content-type
| Location
| Status
| extension-header
The response comprises headers and a body, separated by a blank line.
The headers are either CGI headers to be interpreted by the server,
or HTTP headers to be included in the response returned to the client
if the request method is HTTP. At least one CGI-Header must be
supplied, but no CGI header can be repeated with the same field-name.
If a body is supplied, then a Content-type header is required,
otherwise the script must send a Location or Status header. If a
Location header is returned, then no HTTP-Headers may be supplied.
[...]
Location
This is used to specify to the server that the script is returning
a reference to a document rather than an actual document.
[...]
The location value is either an absolute URI with optional
fragment, as defined in RFC 1630 [1], or an absolute path and
optional query-string. If an absolute URI is returned by the
script, then the server will generate a redirect HTTP response
message, and if no entity body is supplied by the script, then the
server will produce one. If the Location value is a path, then the
server will generate the response that it would have produced in
response to a request containing the URL
protocol "://" SERVER_NAME ":" SERVER_PORT rel-URL-abs-path
The location header may only be sent if the REQUEST_METHOD is HEAD
or GET.