Skip to content

Commit 44ad1ce

Browse files
committed
feature: now the raw headers for each part are also returned, as suggested by zou2062 in github issue openresty#1.
1 parent 157b798 commit 44ad1ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/resty/upload.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function read_header(self)
183183
return 'header', line
184184
end
185185

186-
return 'header', {key, value}
186+
return 'header', {key, value, line}
187187
end
188188

189189

t/sanity.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ value\r
6767
\r\n-----------------------------820127721219505131303151179--\r
6868
}
6969
--- response_body
70-
read: ["header",["Content-Disposition","form-data; name=\"file1\"; filename=\"a.txt\""]]
71-
read: ["header",["Content-Type","text\/plain"]]
70+
read: ["header",["Content-Disposition","form-data; name=\"file1\"; filename=\"a.txt\"","Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\""]]
71+
read: ["header",["Content-Type","text\/plain","Content-Type: text\/plain"]]
7272
read: ["body","Hello"]
7373
read: ["body",", wor"]
7474
read: ["body","ld"]
7575
read: ["part_end"]
76-
read: ["header",["Content-Disposition","form-data; name=\"test\""]]
76+
read: ["header",["Content-Disposition","form-data; name=\"test\"","Content-Disposition: form-data; name=\"test\""]]
7777
read: ["body","value"]
7878
read: ["body","\r\n"]
7979
read: ["part_end"]

0 commit comments

Comments
 (0)