File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
web-server-lib/web-server/http Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 194194 (lambda (pf)
195195 (list 'parsefail (exn-message pf)))])
196196 (match (content-disposition-parser rhs)
197- [(list matched #"" )
197+ [(list matched (regexp #px#" ^[[:space:]]*$ " (list _ )) )
198198 (match matched
199199 [(list ty clauses)
200200 (list ty (for/list ([c (in-list clauses)])
249249 ((#"name " #"abcz " )
250250 (#"filename " #"abc\"d " ))))
251251
252+ (check-equal?
253+ (parse-content-disposition-header
254+ #" attachment; filename=\"\\\\foo.html\"\n " )
255+ '(#"attachment "
256+ ((#"filename " #"\\foo.html " ))))
257+
252258(check-equal? (TOKEN #"form-data ; " )
253259 (list #"form-data " #" ; " ))
254260
284290 (check-equal? (QTDSTR #"\"filename=\" " )
285291 (list '(quoted (#"filename= " )) #"" ))
286292
293+
287294
288295(check-equal?
289296 (content-disposition-parser
294301 (SEMI (#"filename " EQ (quoted (#"wallaby " ))))))
295302 #"" ))
296303
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+
297313 (check-match
298314 (parse-content-disposition-header
299315 #"form-data; name=\"filen\"ame=\"; zokbar=\"dingo\"; filename=\"wallaby\" " )
You can’t perform that action at this time.
0 commit comments