File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ source " $root " /lib.bash
4+
5+ " $ghfs " -l 3003 -r " $fs " /vhost1 &
6+ sleep 0.05 # wait server ready
7+
8+ (curl_get_header http://127.0.0.1:3003/file1.txt | grep -q -i -F ' content-disposition' ) &&
9+ fail " Content-Disposition header should not exists"
10+
11+ (curl_get_header http://127.0.0.1:3003/file1.txt? download | grep -q -i -F ' content-disposition' ) ||
12+ fail " Content-Disposition header is not exists"
13+
14+ kill %1
Original file line number Diff line number Diff line change @@ -20,13 +20,16 @@ curl_head_status() {
2020
2121curl_get_status () {
2222 url=" $1 "
23- opts=" $2 "
2423 curl -s -k -i " $url " | head -n 1 | cut -d ' ' -f 2
2524}
2625
26+ curl_get_header () {
27+ url=" $1 "
28+ curl -s -k -i " $url " | sed -e ' /^$/q'
29+ }
30+
2731curl_get_body () {
2832 url=" $1 "
29- opts=" $2 "
3033 curl -s -k " $url "
3134}
3235
Original file line number Diff line number Diff line change 22
33cd $( dirname $0 )
44
5- for cmd in realpath curl grep; do
5+ for cmd in realpath curl grep sed ; do
66 type " $cmd " & > /dev/null
77 if [ $? -ne 0 ]; then
88 echo " command '$cmd ' not found" >&2
You can’t perform that action at this time.
0 commit comments