API Fetch: Improve isMediaUploadRequest check #34417
Open
+50
−5
Conversation
4 of 7 tasks
This worked for me as advertised, and when applied to #34389 it correctly paged the result set for galleries over 100 when per_page set to -1. I don't think I have enough background around this part of the code though to sign off on it. @youknowriad, can you see any gotchas with this since you initially added this middleware? The background is that this change is needed to switch the gallery |
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.
Mamaduka commentedAug 31, 2021
Description
Updates
isMediaUploadRequest
check and to allowper_page=-1
get requests for media items.Fixes #34410.
How has this been tested?
Unit tests are running locally:
Running the following code in the browser console doesn't result in the error -
400: Invalid parameter(s): per_page
Check that
mediaUploadMiddleware
is applied to upload requests. This can be done by checking the "Request call stack" in the Network tab.Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).