about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-24 21:28:50 +0000
committerEric Wong <e@80x24.org>2015-11-24 21:29:44 +0000
commit5b7e9316a5a9deac64330e8cb6d10785dc7dfc7c (patch)
treed08a0276b80592cef7df6132188a8d78ebce6605 /t
parent129fcb3dcc1fecd32b7e73d6ea30c8c6aedbb259 (diff)
It's possible curl will be sending to us and detect an error in the
send before it has a chance to read our (premature) 413 response.

Of course, we cannot afford to read an entire request when returning
a premature 413 response because we risk wasting bandwidth that way.
Diffstat (limited to 't')
-rwxr-xr-xt/t0105-rack-input-limit-bigger.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t0105-rack-input-limit-bigger.sh b/t/t0105-rack-input-limit-bigger.sh
index 1ae0191..ee03d44 100755
--- a/t/t0105-rack-input-limit-bigger.sh
+++ b/t/t0105-rack-input-limit-bigger.sh
@@ -25,7 +25,11 @@ t_begin "stops a regular request" && {
         rm -f $tmp
         dbgcat curl_err
         dbgcat curl_out
-        grep 413 $curl_err
+        if ! grep 413 $curl_err
+        then
+                # send error as documented in curl(1) manpage
+                grep -F '(55)' $curl_err
+        fi
         test -e $ok
 }
 
@@ -36,7 +40,11 @@ t_begin "stops a large chunked request" && {
           http://$listen/ > $curl_out 2> $curl_err || > $ok
         dbgcat curl_err
         dbgcat curl_out
-        grep 413 $curl_err
+        if ! grep 413 $curl_err
+        then
+                # send error as documented in curl(1) manpage
+                grep -F '(55)' $curl_err
+        fi
         test -e $ok
 }