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

Add shareable extension-to-MIME-type mapping #1355

Merged
merged 2 commits into from
May 2, 2024

Conversation

brandonpayton
Copy link
Member

What is this PR doing?

This PR switches from a hard-coded MIME type list to a JSON based extention-to-MIME-type mapping.

What problem is it solving?

PHPRequestHandler and the WP Cloud PHP request handler use different MIME type mappings.

How is the problem addressed?

This PR adds a JSON file that can be used by both. Both lists contained file extensions the other did not, so the new mapping combines both.

GitHub co-pilot was handy for:

  • quickly converting the existing MIME type switch statement to JSON
  • sorting and removing duplicate keys from the combined mapping in JSON

The WP Cloud PHP request handler will be updated to use the mapping JSON in a separate PR.

Testing Instructions

  • Smoke test Playground locally
  • Make sure e2e tests pass

@brandonpayton brandonpayton merged commit 9b2debf into trunk May 2, 2024
5 checks passed
@brandonpayton brandonpayton deleted the share-single-mime-type-mapping branch May 2, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants