mirror of https://github.com/nealey/eris.git
passing all tests
This commit is contained in:
parent
ba030d7917
commit
71112ac2a7
4
eris.c
4
eris.c
|
@ -181,7 +181,7 @@ not_found()
|
||||||
|
|
||||||
header(404, "Not Found");
|
header(404, "Not Found");
|
||||||
printf("Content-Type: text/html\r\n");
|
printf("Content-Type: text/html\r\n");
|
||||||
printf("Content-Length: %d\r\n", sizeof msg);
|
printf("Content-Length: %lu\r\n", sizeof msg);
|
||||||
printf("\r\n");
|
printf("\r\n");
|
||||||
printf("%s\n", msg); /* sizeof msg includes the NULL */
|
printf("%s\n", msg); /* sizeof msg includes the NULL */
|
||||||
dolog(404, sizeof msg);
|
dolog(404, sizeof msg);
|
||||||
|
@ -541,7 +541,7 @@ handle_request()
|
||||||
badrequest(505, "Version Not Supported", "HTTP/0.9 not supported");
|
badrequest(505, "Version Not Supported", "HTTP/0.9 not supported");
|
||||||
case '?':
|
case '?':
|
||||||
query_string = p + 1;
|
query_string = p + 1;
|
||||||
break;
|
continue;
|
||||||
case '.':
|
case '.':
|
||||||
if (p[-1] == '/') {
|
if (p[-1] == '/') {
|
||||||
c = ':';
|
c = ':';
|
||||||
|
|
2
test.sh
2
test.sh
|
@ -127,7 +127,7 @@ title "Basic CGI"
|
||||||
printf 'GET /a.cgi HTTP/1.0\r\n\r\n' | $HTTPD_CGI 2>/dev/null | d | grep -q 'HTTP/1.0 200 OK#%Server: .*#%Connection: close#%Pragma: no-cache#%Content-type: text/plain#%#%james%' && pass || fail
|
printf 'GET /a.cgi HTTP/1.0\r\n\r\n' | $HTTPD_CGI 2>/dev/null | d | grep -q 'HTTP/1.0 200 OK#%Server: .*#%Connection: close#%Pragma: no-cache#%Content-type: text/plain#%#%james%' && pass || fail
|
||||||
|
|
||||||
title "GET with arguments"
|
title "GET with arguments"
|
||||||
printf 'GET /a.cgi?foo HTTP/1.0\r\n\r\n' | $HTTPD_CGI 2>/dev/null | d | grep -q 'HTTP/1.0 200 OK#%Server: .*#%Pragma: no-cache#%Connection: close#%Content-type: text/plain#%#%foo%' && pass || fail
|
printf 'GET /a.cgi?foo HTTP/1.0\r\n\r\n' | $HTTPD_CGI 2>/dev/null | d | grep -q 'HTTP/1.0 200 OK#%Server: .*#%Connection: close#%Pragma: no-cache#%Content-type: text/plain#%#%foo%' && pass || fail
|
||||||
|
|
||||||
title "POST"
|
title "POST"
|
||||||
printf 'POST /a.cgi HTTP/1.0\r\nContent-Type: moo\r\nContent-Length: 3\r\n\r\narf' | $HTTPD_CGI 2>/dev/null | d | grep -q 't:moo%v:arf$' && pass || fail
|
printf 'POST /a.cgi HTTP/1.0\r\nContent-Type: moo\r\nContent-Length: 3\r\n\r\narf' | $HTTPD_CGI 2>/dev/null | d | grep -q 't:moo%v:arf$' && pass || fail
|
||||||
|
|
Loading…
Reference in New Issue