Skip to content

Commit fe09dd6

Browse files
committed
Fix multipart boundaries in regression tests
- Remove the redundant "--" prefix from boundaries. - Add the missing Content-Type header for multipart bodies.
1 parent cebcde3 commit fe09dd6

14 files changed

Lines changed: 34 additions & 31 deletions

test/test-cases/regression/action-ctl_request_body_access.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/test",
@@ -78,7 +78,7 @@
7878
"User-Agent":"curl/7.38.0",
7979
"Accept":"*/*",
8080
"Content-Length":"330",
81-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
81+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
8282
"Expect":"100-continue"
8383
},
8484
"uri":"/test",
@@ -139,7 +139,7 @@
139139
"User-Agent":"curl/7.38.0",
140140
"Accept":"*/*",
141141
"Content-Length":"330",
142-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
142+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
143143
"Expect":"100-continue"
144144
},
145145
"uri":"/test",

test/test-cases/regression/config-body_limits.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
"headers":{
9696
"Host":"localhost",
9797
"User-Agent":"curl/7.38.0",
98-
"Accept":"*/*"
98+
"Accept":"*/*",
99+
"Content-Type": "multipart/form-data; boundary=------------------------756b6d74fa1a8ee2"
99100
},
100101
"uri":"/?key=value&key=other_value",
101102
"method":"POST",
@@ -152,7 +153,8 @@
152153
"headers":{
153154
"Host":"localhost",
154155
"User-Agent":"curl/7.38.0",
155-
"Accept":"*/*"
156+
"Accept":"*/*",
157+
"Content-Type": "multipart/form-data; boundary=------------------------756b6d74fa1a8ee2"
156158
},
157159
"uri":"/?key=value&key=other_value",
158160
"method":"POST",
@@ -209,7 +211,8 @@
209211
"headers":{
210212
"Host":"localhost",
211213
"User-Agent":"curl/7.38.0",
212-
"Accept":"*/*"
214+
"Accept":"*/*",
215+
"Content-Type": "multipart/form-data; boundary=------------------------756b6d74fa1a8ee2"
213216
},
214217
"uri":"/?key=value&key=other_value",
215218
"method":"POST",
@@ -266,7 +269,7 @@
266269
"headers":{
267270
"Host":"localhost",
268271
"User-Agent":"curl/7.38.0",
269-
"Accept":"*/*"
272+
"Content-Type": "multipart/form-data; boundary=------------------------756b6d74fa1a8ee2"
270273
},
271274
"uri":"/?key=value&key=other_value",
272275
"method":"POST",

test/test-cases/regression/variable-FULL_REQUEST.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/",
@@ -50,8 +50,8 @@
5050
"no need."
5151
]
5252
},
53-
"expected":{
54-
"debug_log":"Multipart: Boundary: --------------------------756b6d74fa1a8ee2"
53+
"expected":{
54+
"debug_log":"Multipart: Boundary: ------------------------756b6d74fa1a8ee2"
5555
},
5656
"rules":[
5757
"SecRuleEngine On",

test/test-cases/regression/variable-FULL_REQUEST_LENGTH.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/",
@@ -50,8 +50,8 @@
5050
"no need."
5151
]
5252
},
53-
"expected":{
54-
"debug_log":"Target value: \"690\" \\(Variable: FULL_REQUEST_LENGTH\\)"
53+
"expected":{
54+
"debug_log":"Target value: \"688\" \\(Variable: FULL_REQUEST_LENGTH\\)"
5555
},
5656
"rules":[
5757
"SecRuleEngine On",

test/test-cases/regression/variable-INBOUND_DATA_ERROR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"User-Agent":"curl/7.38.0",
5757
"Accept":"*/*",
5858
"Content-Length":"330",
59-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
59+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
6060
"Expect":"100-continue"
6161
},
6262
"uri":"/",

test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary= --------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary= ------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/",
@@ -76,7 +76,7 @@
7676
"User-Agent":"curl/7.38.0",
7777
"Accept":"*/*",
7878
"Content-Length":"330",
79-
"Content-Type":"multipart/form-data; boundary=\"--------------------------756b6d74fa1a8ee2\"",
79+
"Content-Type":"multipart/form-data; boundary=\"------------------------756b6d74fa1a8ee2\"",
8080
"Expect":"100-continue"
8181
},
8282
"uri":"/",

test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"User-Agent":"curl/7.38.0",
5858
"Accept":"*/*",
5959
"Content-Length":"330",
60-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
60+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
6161
"Expect":"100-continue"
6262
},
6363
"uri":"/",

test/test-cases/regression/variable-REQBODY_PROCESSOR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"Host":"localhost",
9595
"User-Agent":"curl/7.38.0",
9696
"Accept":"*/*",
97-
"Content-Type": "multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2"
97+
"Content-Type": "multipart/form-data; boundary=------------------------756b6d74fa1a8ee2"
9898
},
9999
"uri":"/?key=value&key=other_value",
100100
"http_version":1.1,

test/test-cases/regression/variable-REQUEST_BODY.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/",

test/test-cases/regression/variable-REQUEST_BODY_LENGTH.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"User-Agent":"curl/7.38.0",
1818
"Accept":"*/*",
1919
"Content-Length":"330",
20-
"Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2",
20+
"Content-Type":"multipart/form-data; boundary=------------------------756b6d74fa1a8ee2",
2121
"Expect":"100-continue"
2222
},
2323
"uri":"/",

0 commit comments

Comments
 (0)