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

WP-NOW: Simplify multipart requests by dropping manually encoding #261

Merged

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented May 13, 2024

What?

Drop manually encoding multipart requests. This PR is a follow-up of #203.

Why?

This PR follows this discussion regarding the necessity of manually encoding multipart requests. Additionally, it addresses #259.

How?

  • Remove Express fileUpload middleware to avoid modifying the request object.
  • Remove encodeAsMultipart helper, since we don't need to process them differently (Playground CLI example).

Testing Instructions

  1. Run the command: nvm use && npm install.
  2. Run the command nx preview wp-now start.
  3. Open the WP-admin page (e.g. http://localhost:8881/wp-admin).
  4. Navigate to the Media page.
  5. Upload a media file.
  6. Observe the media has been uploaded correctly to the Media Library.
Copy link
Collaborator

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!,
So, the helper library was messing up instead of solving the issue.

Thanks for trying it and creating the PR!

no-library-for-file-uplaod.mp4

I can deploy it tomorrow. I'll probably need some time to improve the GitHub action.

@sejas sejas merged commit cfc8013 into WordPress:trunk May 15, 2024
2 checks passed
@fluiddot fluiddot deleted the update/wp-now-simplify-multipart-requests branch May 16, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants