mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
add test case for request_body
handler
This commit is contained in:
parent
01ae168f92
commit
9ba7ea76a9
1 changed files with 35 additions and 0 deletions
35
caddytest/spec/http/requestbody/spec.hurl
Normal file
35
caddytest/spec/http/requestbody/spec.hurl
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# Configure Caddy
|
||||||
|
POST http://localhost:2019/load
|
||||||
|
Content-Type: text/caddyfile
|
||||||
|
```
|
||||||
|
{
|
||||||
|
skip_install_trust
|
||||||
|
http_port 9080
|
||||||
|
https_port 9443
|
||||||
|
local_certs
|
||||||
|
}
|
||||||
|
localhost {
|
||||||
|
log
|
||||||
|
request_body {
|
||||||
|
max_size 2B
|
||||||
|
}
|
||||||
|
reverse_proxy localhost:8000 # to fake body reading
|
||||||
|
handle_errors 4xx {
|
||||||
|
respond "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
http://localhost:8000 {
|
||||||
|
respond "Failed"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
GET https://localhost:9443
|
||||||
|
[Options]
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
Hello
|
||||||
|
```
|
||||||
|
HTTP 413
|
||||||
|
`OK`
|
||||||
|
|
||||||
|
# TODO: how to test{read,write}_timeout?
|
Loading…
Reference in a new issue