File tree 1 file changed +17
-1
lines changed
web-server-lib/web-server/http
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 194
194
(lambda (pf)
195
195
(list 'parsefail (exn-message pf)))])
196
196
(match (content-disposition-parser rhs)
197
- [(list matched #"" )
197
+ [(list matched (regexp #px#" ^[[:space:]]*$ " (list _ )) )
198
198
(match matched
199
199
[(list ty clauses)
200
200
(list ty (for/list ([c (in-list clauses)])
249
249
((#"name " #"abcz " )
250
250
(#"filename " #"abc\"d " ))))
251
251
252
+ (check-equal?
253
+ (parse-content-disposition-header
254
+ #" attachment; filename=\"\\\\foo.html\"\n " )
255
+ '(#"attachment "
256
+ ((#"filename " #"\\foo.html " ))))
257
+
252
258
(check-equal? (TOKEN #"form-data ; " )
253
259
(list #"form-data " #" ; " ))
254
260
284
290
(check-equal? (QTDSTR #"\"filename=\" " )
285
291
(list '(quoted (#"filename= " )) #"" ))
286
292
293
+
287
294
288
295
(check-equal?
289
296
(content-disposition-parser
294
301
(SEMI (#"filename " EQ (quoted (#"wallaby " ))))))
295
302
#"" ))
296
303
304
+ (check-equal?
305
+ (content-disposition-parser
306
+ #" form-data; name=\"filename=\"; zokbar=\"dingo\"; filename=\"wallaby\" " )
307
+ (list `(#"form-data "
308
+ ((SEMI (#"name " EQ (quoted (#"filename= " ))))
309
+ (SEMI (#"zokbar " EQ (quoted (#"dingo " ))))
310
+ (SEMI (#"filename " EQ (quoted (#"wallaby " ))))))
311
+ #"" ))
312
+
297
313
(check-match
298
314
(parse-content-disposition-header
299
315
#"form-data; name=\"filen\"ame=\"; zokbar=\"dingo\"; filename=\"wallaby\" " )
You can’t perform that action at this time.
0 commit comments