Bug 48422 - Can't edit Content-Type Header
Summary: Can't edit Content-Type Header
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_headers (show other bugs)
Version: 2.2.14
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Reported: 2009-12-20 16:13 UTC by Cyril Bonté
Modified: 2010-07-05 15:25 UTC (History)
1 user (show)

patch to allow to edit the Content-Type header (760 bytes, application/octet-stream)
2009-12-20 16:13 UTC, Cyril Bonté

Note You need to log in before you can comment on or make changes to this bug.
Description Cyril Bonté 2009-12-20 16:13:00 UTC
Created attachment 24743 [details]
patch to allow to edit the Content-Type header

Currently, the "set" command allows to modify the Content-Type Header, but the "edit" one can't.

Comparing the 2 portions of code, there's a special case in the "set" part to manage this specific header,which doesn't exist in the "edit" part. It would be useful to allow to edit the Content-Type (in my case, this is to remove the charset sent by tomcat for some devices).
Comment 1 Cyril Bonté 2009-12-21 03:28:10 UTC
I prefer to edit the report to change "enhancement" to "minor".
As there's nothing in the documentation that explain this difference of behaviour between set and edit, it's maybe better to qualify it as a minor bug.
Comment 2 Nick Kew 2009-12-26 14:58:45 UTC
Your patch touches on some possible side-effects due to hacks in r->content_type.  The assumption that it's not NULL could cause segfault (and will, if used with "early").

Committing a variant on your patch to trunk.  It still risks side-effects, but these will be aligned with what, as you point out, we already have with Header set.
Comment 3 Cyril Bonté 2009-12-28 13:51:28 UTC
Ah yes, thanks for the fixed patch, it works well on a modified 2.2.14 version.
Do you know if there's a chance it can be merged in the 2.2.x branch ?
Comment 4 Stefan Fritsch 2010-02-03 14:37:53 UTC
the trunk commit is in r894034
Comment 5 Nick Kew 2010-07-05 15:25:34 UTC
Resolving this to LATER.  Since ap_set_content_type has side-effects, I'm not going to propose the patch for backport.  But trunk or patched mod_headers should work cleanly with 2.2 for anyone who wants it.