[package] busybox: update to v1.13.4 (closes: #4279)
[openwrt-10.03/.git] / package / busybox / patches / 410-httpd_cgi_headers.patch
1 --- a/networking/httpd.c
2 +++ b/networking/httpd.c
3 @@ -1259,10 +1259,10 @@ static NOINLINE void cgi_io_loop_and_exi
4                                                 if (full_write(STDOUT_FILENO, HTTP_200, sizeof(HTTP_200)-1) != sizeof(HTTP_200)-1)
5                                                         break;
6                                         }
7 -                                       /* Commented out:
8 -                                       if (!strstr(rbuf, "ontent-")) {
9 -                                               full_write(s, "Content-type: text/plain\r\n\r\n", 28);
10 +                                       if (!strstr(rbuf, "ontent-") && !strstr(rbuf, "ocation:")) {
11 +                                               full_write(1, "Content-type: text/plain\r\n\r\n", 28);
12                                         }
13 +                                       /* Previously commented out:
14                                          * Counter-example of valid CGI without Content-type:
15                                          * echo -en "HTTP/1.0 302 Found\r\n"
16                                          * echo -en "Location: http://www.busybox.net\r\n"