Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mediaUploadMiddleware is applied to every media endpoint request #34410

Closed
Mamaduka opened this issue Aug 31, 2021 · 0 comments · Fixed by #34417
Closed

The mediaUploadMiddleware is applied to every media endpoint request #34410

Mamaduka opened this issue Aug 31, 2021 · 0 comments · Fixed by #34417
Assignees
Labels
[Feature] Media Anything that impacts the experience of managing media REST API Interaction Related to REST API [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Mamaduka
Copy link
Member

Mamaduka commented Aug 31, 2021

Currently the mediaUploadMiddleware is applied to every request for /wp/v2/media endpoint.

The middleware sets options.parse to false, which causes fetchAllMiddleware to bail early. The latter prevents doing per_page=-1 queries for media items.

I discovered this while debugging a different PR #34389 (comment).

We should update the isMediaUploadRequest check only to return true when the request also has the POST method.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media REST API Interaction Related to REST API labels Aug 31, 2021
@Mamaduka Mamaduka self-assigned this Aug 31, 2021
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media REST API Interaction Related to REST API [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant