[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [BusyBox] httpd and cgi
From: Chris Simmonds <chris () 2net ! co ! uk>
Date: 2003-04-28 14:16:22
[Download RAW message or body]
Hi Steven,
The problem is not with the HTTP/1.0 line: you tell the browser the type
with the "Content-type" tag. The default is text/plain, which is
displayed as you describe. In your case you need
Content-type: text/html
Chris.
Steven Scholz wrote:
> Hi there,
>
> I want an cgi script to generate a vaild html page that than is send
> to the browser.
>
> But I noticed that busybox' httpd itself is prepending an "HTTP/1.0
> 200 OK\n" if this is not contained in the buffer return from the cgi
> script.
>
> line 1150:
> if (firstLine) {
> /* check to see if the user script added headers */
> if (strncmp(buf, "HTTP/1.0 200 OK\n", 4) != 0) {
> bb_full_write(s, "HTTP/1.0 200 OK\n", 16);
> }
> if (strstr(buf, "ontent-") == 0) {
> bb_full_write(s, "Content-type: text/plain\n\n", 26);
> }
> firstLine=0;
> }
>
> And that "HTTP/1.0 200 OK\n" apparently causes my browser to display
> the html stuff as text instead of interpreting them.
>
> So instead of viewing a nice web page created by the cgi script I only
> see the source code of it.
>
> Is that normal, standard behaviour in handling CGI?
> How can I work around this httpd "feature"?
>
> Thanks,
>
> Steven
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://codepoet.org/mailman/listinfo/busybox
>
--
Chris Simmonds 2net Limited
chris@2net.co.uk http://www.2net.co.uk/
Tel: +44 (0)1962 869003 Fax: +44 (0)870 056 7556
"If it's not connected, it's not effective"(tm)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic