test CGI with big files

This commit is contained in:
Omar Polo 2021-01-24 10:24:34 +00:00
parent 28ec617809
commit 7b31a6386d
3 changed files with 13 additions and 1 deletions

View File

@ -33,7 +33,7 @@ testdata: fill-file
./sha testdata/bigfile testdata/bigfile.sha
printf "# hello world\n" > testdata/index.gmi
./sha testdata/index.gmi testdata/index.gmi.sha
cp hello slow err invalid testdata/
cp hello slow err invalid serve-bigfile testdata/
mkdir testdata/dir
cp testdata/index.gmi testdata/dir/foo.gmi

View File

@ -171,6 +171,13 @@ echo OK GET /err with cgi
eq "$(raw /invalid | wc -c | xargs)" 2048 "Unexpected body for /invalid"
echo OK GET /invalid with cgi
# try a big file
eq "$(head /serve-bigfile)" "20 application/octet-stream" "Unexpected head for /serve-bigfile"
get /bigfile > bigfile
./sha bigfile bigfile.sha
eq "$(cat bigfile.sha)" "$(cat testdata/bigfile.sha)" "Unexpected sha for /serve-bigfile"
echo OK GET /serve-bigfile with cgi
check "should be running"
quit

5
regress/serve-bigfile Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
printf "20 application/octet-stream\r\n"
exec cat bigfile