CGI script and Content-type change in 1.4.0
Denis Vlasenko
vda.linux at googlemail.com
Thu Feb 1 14:57:03 PST 2007
On Wednesday 31 January 2007 09:28, Alexander Griesser wrote:
> Hi folks!
>
> Another thing that broke when upgrading to 1.4.0 is the management
> interface for my thinclients.
>
> Previously, I used the following command to output a valid HTML header:
>
> echo 'Content-type: text/html
>
>
> <html>
> <head>
> ...'
>
> Now, with busybox 1.4.0, this doesn't work anymore.
> I get exactly the same output as written above in firefox (IE7 works
> fine).
>
> I had a look at the changelog and found the following entry:
>
> || httpd: stop adding our own "Content-type:" to CGI output
>
> Additionally, I found a cgi-example (httpd_index_cgi_example) inside
> the busybox distribution that suggests do pipe all output generated
> through "dd bs=4k" with the following comment:
>
> # Pipe thru dd (need to write header as single write(),
> # or else httpd doesn't see "Content-type: text/html"
> # in first read() and decides that it is not html)
>
> Why is this needed with the current busybox release or are there any
> ways to work around this?
This piping not needed anymore, it has been fixed
after indexer example was addded.
Regarding your script: I must admit I am not a CGI expert,
but maybe you need to echo "HTTP/1.0 200 OK\r\n" first.
I just tested and cgi indexer works (also without piping thru dd),
so at least this cgi example is working.
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.
Thanks.
--
vda
More information about the busybox
mailing list