From a6eb2d232fcca7d22dd720028122fd9d344e8fa4 Mon Sep 17 00:00:00 2001 From: bel2125 Date: Sun, 20 Mar 2016 20:27:30 +0100 Subject: [PATCH] Linux shell scripts used as CGI process must still return \r\n at the end of header lines --- test/linux.cgi | 4 ++-- test/public_server.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/linux.cgi b/test/linux.cgi index 472a06a0..f65fc7a0 100755 --- a/test/linux.cgi +++ b/test/linux.cgi @@ -1,7 +1,7 @@ #!/bin/sh -echo "Content-Type: text/plain" -echo +printf "Content-Type: text/plain\r\n" +printf "\r\n" echo "This is a shell script called by CGI:" echo diff --git a/test/public_server.c b/test/public_server.c index ece28d47..8875f0ca 100644 --- a/test/public_server.c +++ b/test/public_server.c @@ -983,10 +983,10 @@ START_TEST(test_request_handlers) #else f = fopen("test.cgi", "w"); cgi_script_content = "#!/bin/sh\n\n" - "echo \"Connection: close\"\n" - "echo \"Content-Type: text/plain\"\n" - "echo\n" - "echo \"CGI test\"\n" + "printf \"Connection: close\\r\\n\"\n" + "printf \"Content-Type: text/plain\\r\\n\"\n" + "printf \"\\r\\n\"\n" + "printf \"CGI test\\r\\n\"\n" "\n"; fwrite(cgi_script_content, strlen(cgi_script_content), 1, f); fclose(f);