Include changes form PR #923 with additional changes#927
Merged
KernelDeimos merged 6 commits intomasterfrom Sep 26, 2025
Merged
Include changes form PR #923 with additional changes#927KernelDeimos merged 6 commits intomasterfrom
KernelDeimos merged 6 commits intomasterfrom
Conversation
* Add handling of brotli/gzip pre-compressed files Serving pre-compressed brotli/gzip files was not working before, because a file.br.br against the pre-compressed file.br check always returned false. * Bump version from 14.1.1 to 14.1.2
This fixes an issue recently introduced where file extensions ending with `br` are handled even when the dot does not immediately preceded. This introduces erroneous an error when trying to access files with other extensions ending with `br`, such as `.cbr`. I meant to merge the previous PR with this fix included but forgot to commit the suggestion I added in the PR review. This was merged to a feature branch so the main branch was not affected.
Adds --force-content-encoding flag which must be specified to enable the behavior of including the Content-Encoding header in the response when a .br or .gz file is directly requested in the URL.
51206c0 to
109b86a
Compare
Tests whether or not Content-Encoding is present under different cases with and without the --force-content-encoding flag set.
rafiibrahim8
pushed a commit
to rafiibrahim8/http-server
that referenced
this pull request
Oct 25, 2025
…party#927) * feat: add encoding even if .br/.gz specified (http-party#923) * Add handling of brotli/gzip pre-compressed files Serving pre-compressed brotli/gzip files was not working before, because a file.br.br against the pre-compressed file.br check always returned false. * Bump version from 14.1.1 to 14.1.2 * fix: always check the dot This fixes an issue recently introduced where file extensions ending with `br` are handled even when the dot does not immediately preceded. This introduces erroneous an error when trying to access files with other extensions ending with `br`, such as `.cbr`. I meant to merge the previous PR with this fix included but forgot to commit the suggestion I added in the PR review. This was merged to a feature branch so the main branch was not affected. * fix: put new behavior for .br/.gz behind a flag Adds --force-content-encoding flag which must be specified to enable the behavior of including the Content-Encoding header in the response when a .br or .gz file is directly requested in the URL. * test: --force-content-encoding flag Tests whether or not Content-Encoding is present under different cases with and without the --force-content-encoding flag set. * doc: update manpage * sync: package-lock.json --------- Co-authored-by: Andreas Zeitler <andreas.zeitler@protonmail.com>
This was referenced Nov 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes changes made by @azeitler and puts these changes behind the
--force-content-encodingflag to prevent regressions. I need to figure out how to unit test this, that's the only thing blocking merge into master right now.Relevant issues
Contributor checklist
--helpoutputmasterbranchMaintainer checklist