mirror of https://github.com/omar-polo/gmid.git
test CGI with big files
This commit is contained in:
parent
28ec617809
commit
7b31a6386d
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
printf "20 application/octet-stream\r\n"
|
||||
|
||||
exec cat bigfile
|
Loading…
Reference in New Issue