Skip to content

Commit 75fcbed

Browse files
timebugtokers
authored andcommitted
test: added test case for Expect header
1 parent f2a2e5f commit 75fcbed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

t/00-sanity.t

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ location = /t1 {
760760
local opts = {
761761
stream = false,
762762
headers = {
763-
Expect = "100-continue",
763+
Expect = "100-Continue",
764764
},
765765
766766
body = "你好世界你好世界",
@@ -774,6 +774,15 @@ location = /t1 {
774774
775775
ngx.print(r.content)
776776
777+
opts.headers["Expect"] = "100-continue"
778+
local r, err = requests.post(url, opts)
779+
if not r then
780+
ngx.log(ngx.ERR, err)
781+
return
782+
end
783+
784+
ngx.print(r.content)
785+
777786
local r, err = requests.post("http://127.0.0.1:10088/t10", opts)
778787
assert(r == nil)
779788
ngx.log(ngx.ERR, err)
@@ -783,7 +792,7 @@ location = /t1 {
783792
--- request
784793
GET /t1
785794

786-
--- response_body: 你好世界你好世界
795+
--- response_body: 你好世界你好世界你好世界你好世界
787796

788797
--- grep_error_log: invalid 100-continue response
789798
--- grep_error_log_out

0 commit comments

Comments
 (0)