Repository navigation
Conversation
We can rely on Falcon's handling of form posts for `load_form` so long as we define some parameters around it. Based on discussion, it seems like the simplest option is to skip support for multipart forms, directing any users to use `load_media` instead, and to make `load_form` use the underlying `get_media` call after checking the content type. The content-type check is the same loose one which was present before. Remove the `parse_form_body` helper, as no longer needed.
When used in an async parser / async app, it is possible for the falcon parser's `load_form` to be called within an async app. In such a case, `get_media()` returns an awaitable, and failing to handle this results in an error. 1. Add a missing unit test which confirms that you can use the "form" location inside of an async application. 2. Wrap the result of `load_form()` as a coroutine to make it awaitable, where awaiting the coroutine awaits the underlying falcon-provided object. In order to make (2) into a reusable paradigm, it's now implemented on the base parser as a sibling of `_makeproxy` (which builds multidict proxies), `_makeproxy_awaitable`. Additionally, this improves the typing applied to `_makeproxy` as a side-benefit from exploring better typing and overloads.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've picked up the work started in #1080 and #1079, and tried to push it forward to a good place.
This is one of the things I want (which therefore became blocking) in the webargs 9.0 release, so I'd like to try to finalize the work.
I decided on a particular way of handling the multipart form issue, which is that it won't be explicitly handled at all, but since users can extend and customize the
webargsparser, there are good workarounds for anyone who wants it.