CGI script and Content-type change in 1.4.0

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Thu Feb 1 23:44:35 UTC 2007


On Thu, Feb 01, 2007 at 11:57:03PM +0100, Denis Vlasenko wrote:
> If you definitely know that CGI should not print "200 OK"
> (IOW: that https server process should add that instead),
> please give me the URL so that I can educate myself too.

Links with specs:
http://hoohoo.ncsa.uiuc.edu/cgi/out.html
http://cgi-spec.golux.com/draft-coar-cgi-v11-03-clean.html#7.0

Basically, there are two different types of CGI scripts (the method to
distinguish between the two types is implementation defined; the first
link defines cgi prefix of nph-):
1. non-parsed header (NPH) output (support not required)
  - all output is sent as is to the client (full HTTP response is
    created by the script)

2. parsed header output (support required)
  - one of the following headers must be present, and will be parsed by
    the server (not limited to one, but no repetitions are allowed):
    * Content-type: the Internet Media Type of the entity body,
       which is to be sent unmodified to the client.
    * Location: specify to the server that the script is
       returning a reference to a document rather than an actual
       document:
      - absolute uri: Location: http://.... -> 302 redirect (unless
        Status also defined);
      - or path: Location: /path/... -> server internally processes the
        redirect and the output is as if the new location was directly
        called (POST and other requests may lose the request body).
    * Status: indicates to the server what status code the server MUST
      use in the response message: Status: [0-9]{3} reason-phrase

  - output consists of header plus body (body may be null):
    * if body, Content-type is mandatory
    * else one of Location or Status is mandatory

  - headers are specified on a single line
  
Also, #8.1 on the second link, Requirements for Servers, should be of
interest.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070201/48863634/attachment-0002.pgp 


More information about the busybox mailing list