Move request sanitization and upload disallowed out of file_upload #16032
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.
This is extracting a (small) piece of #14716 out into it's own PR, with the overarching goal of making the
file_upload
endpoint easier to read and reason about what's happening.There's no real functionality change here (except we move request sanitizing to happen prior to the read only checks, which was done primarily because while the current sanitizers and the current checks are wholly independent of each other, that might not always be the case, so we sanitize first.
Beyond that, all this means is that when reading the
file_upload
method, it's easier to gloss over these checks, as they're just decorators instead of being part of the method body.This also means that the tests that test this functionality no longer need to do heavy weight things like setup databases and make DB queries, making our tests just a little bit faster.