Disable decompression in mod_mime_magic by default#623
Open
notroj wants to merge 1 commit intoapache:trunkfrom
Open
Disable decompression in mod_mime_magic by default#623notroj wants to merge 1 commit intoapache:trunkfrom
notroj wants to merge 1 commit intoapache:trunkfrom
Conversation
notroj
commented
Mar 31, 2026
Collaborator
Author
notroj
left a comment
There was a problem hiding this comment.
Thanks for filing the PR and especially for the docs update.
| @@ -484,6 +488,7 @@ static void *merge_magic_server_config(apr_pool_t *p, void *basev, void *addv) | |||
| apr_palloc(p, sizeof(magic_server_config_rec)); | |||
|
|
|||
| new->magicfile = add->magicfile ? add->magicfile : base->magicfile; | |||
| new->decompression_enabled = add->decompression_enabled; | |||
Collaborator
Author
There was a problem hiding this comment.
This means the setting doesn't inherit properly across vhosts. The simplest way to do this properly is to have ->decomp_enabled default to an "UNSET" macro defined as -1, and then use a ternary operator to inherit in the merge = (add->decompress_enabled != UNSET) ? add->decompress_enabled : base->decompress_enabled. And also adjust the code that uses the field to special-case the UNSET value
| ap_get_module_config(cmd->server->module_config, | ||
| &mime_magic_module); | ||
|
|
||
| if (!conf) { |
Collaborator
Author
There was a problem hiding this comment.
This is unnecessary, that can never return NULL (it's an array lookup).
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.
No description provided.