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

veb,vweb: MIME types should be case insensitive #22483

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

alex-semenyuk
Copy link
Contributor

Close #22425

As mentioned at #22425 MIME types should be case insensitive. So if we have .TXT or .JPG it should be valid as .txt and .jpg

@alex-semenyuk alex-semenyuk marked this pull request as draft October 10, 2024 18:04
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@JalonSolov
Copy link
Contributor

Question: Shouldn't veb be using the net.http.mime module, instead of partially duplicating the MIME types that are already in there?

@alex-semenyuk alex-semenyuk marked this pull request as ready for review October 10, 2024 18:57
@spytheman
Copy link
Member

Question: Shouldn't veb be using the net.http.mime module, instead of partially duplicating the MIME types that are already in there?

Ideally yes, but realistically - no.

The DB in net.http.mime is huge when uncompressed, and with the current implementation of net.http.mime and the current compiler, means both much bigger veb executables (+2.1MB without -prod, +396KB with -prod), and much more time, spend during optimization (compilation with -prod), for producing each of them:
image

The current smaller mime map in veb and vweb before that, favors much faster iteration and smaller executables, which I think is the right balance for both modules, until they mature.

@spytheman spytheman merged commit 9788ae1 into vlang:master Oct 11, 2024
67 checks passed
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.

Unknown MIME type for uppercase JPG
3 participants