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 webp mimetype #62

Merged
merged 1 commit into from
Jun 10, 2024
Merged

add webp mimetype #62

merged 1 commit into from
Jun 10, 2024

Conversation

roelmonnens
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets /
Documentation /
License MIT

What's in this PR?

This adds the mimetype webp to src/ApacheMimetypeHelper.php

Why?

This is used to create a proxy between front and back-end system.
When uploading webp files via this proxy the mimetype isn't passed on.

@dbu dbu merged commit 7d5fd97 into php-http:1.x Jun 10, 2024
13 checks passed
@dbu
Copy link
Contributor

dbu commented Jun 10, 2024

thanks. i will tag a release for this.

for your architecture, i wonder if you can't copy the mime type from the request? there might be other extensions we don't handle (looking at the linked apache list there are a lot of extensions not covered).
the user supplied mime type can be wrong, but the file extension can be wrong too.

@dbu
Copy link
Contributor

dbu commented Jun 10, 2024

@roelmonnens
Copy link
Author

Thnx, this is a quick fix. We are checking how we can avoid this in the future with other unknown mimetypes.

@dbu
Copy link
Contributor

dbu commented Jun 10, 2024

it definitely belongs into the bundle, thats why i merged and tagged it.

but imho a proxy should forward the header and not determine the mime type on its own. but of course you are free to use this as you want.

we could sync more types from apache, but also i think it would make sense to make the mapping extensible for the user of the library somehow. (then your quickfix would not depend on somebody merging and releasing a pull request in an OS project)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants