1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

Fix Multipart consuming payload before header checks (#1704)

* Fix Multipart consuming payload before header checks

What
--
Split up logic in the constructor into two functions:

- **from_boundary:** build Multipart from boundary and stream
- **from_error:** build Multipart for MultipartError

Also we make the `boundary`, `from_boundary`, `from_error`  methods public within the crate so that we can use them in the extractor.

The extractor is then able to perform header checks and only consume the
payload if the checks pass.

* Add tests

* Add payload consumption test

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Matt Gathu
2020-09-25 15:50:37 +02:00
committed by GitHub
parent 60e7e52276
commit 37c76a39ab
3 changed files with 70 additions and 17 deletions

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2020-xx-xx
* Fix multipart consuming payload before header checks #1513
## 3.0.0 - 2020-09-11