-
Notifications
You must be signed in to change notification settings - Fork 61
Add HTTP content-type for WebP and AVIF #229
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 HTTP content-type for WebP and AVIF #229
Conversation
This PR extends the _setContentTypeFromPath method to correctly identify and assign Content-Type headers for .webp (image/webp) and .avif (image/avif) files. Additionally, all HTTP headers are now formatted in Title Case, aligning with RFC 7231 and improving consistency across responses. Developers are encouraged to adopt AVIF or WebP formats over legacy image types such as GIF, PNG, or JPEG. Both formats are fully supported by all major modern browsers and typically offer significant file size reductions (often 50% or more) without perceptible quality loss. Conversion of assets is straightforward using tools like squoosh.app (free and online), which supports batch optimization and visual comparisons across formats.
src/literals.h
Outdated
@@ -3,194 +3,198 @@ | |||
|
|||
#pragma once | |||
|
|||
namespace asyncsrv { | |||
namespace asyncsrv | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not change the styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add the label and see of lint solves that.
@JosePineiro : please have a look at #230 thanks ! |
This PR contains more than it says in the title. I suggest to split it in two PRs, one for adding the two types and another for changing the case of strings |
me-no-dev requests fulfilled: - please do not change the styling - to split it in two PRs
This PR extends the _setContentTypeFromPath method to correctly identify and assign Content-Type headers for .webp (image/webp) and .avif (image/avif) files. Additionally, all HTTP headers are now formatted in Title Case, aligning with RFC 7231 and improving consistency across responses.
Developers are encouraged to adopt AVIF or WebP formats over legacy image types such as GIF, PNG, or JPEG. Both formats are fully supported by all major modern browsers and typically offer significant file size reductions (often 50% or more) without perceptible quality loss.
Conversion of assets is straightforward using tools like squoosh.app (free and online), which supports batch optimization and visual comparisons across formats.