Am I parsing this HTTP POST request properly?

前端 未结 3 1305
天涯浪人
天涯浪人 2021-01-20 19:02

Let me start off by saying, I\'m using the twisted.web framework. Twisted.web\'s file uploading didn\'t work like I wanted it to (it only included

3条回答
  •  终归单人心
    2021-01-20 20:04

    The content-disposition header has no defined order for fields, plus it may contain more fields than just the filename. So your match for filename may fail - there may not even be a filename!

    See rfc2183 (edit that's for mail, see rfc1806, rfc2616 and maybe more for http)

    Also I would suggest in these kind of regexps to replace every space by \s*, and not to rely on character case.

提交回复
热议问题