Closed Bug 938596 Opened 11 years ago Closed 11 years ago

Add hook for modifying HTTP headers

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 2 obsolete files)

Bug 600692, as one example, requires the addition of extra HTTP headers. And there have been various other security specs which require it, some of which we now support natively (e.g. X-XSS-Protection, X-Frame-Options). We should have a hook in Bugzilla::CGI::header() which allows manipulation of HTTP headers. Gerv
Severity: normal → enhancement
Attached patch 938596.diff (obsolete) — Splinter Review
This patch converts the data structure in the function to a more hook-friendly hash rather than a list, and passes it to a new hook. Is the "cgi" param necessary, or should a hook just get it from Bugzilla->cgi? It could be that the hook doesn't always have the info it needs to make a decision whether or not to add a particular header, but I'm not sure how to give it more. Gerv
Assignee: general → gerv
Status: NEW → ASSIGNED
Attachment #832292 - Flags: review?(glob)
Attached patch Patch v.2 (obsolete) — Splinter Review
Sorry; forgot to regenerate patch before attaching. :-| Gerv
Attachment #832292 - Attachment is obsolete: true
Attachment #832292 - Flags: review?(glob)
Attachment #832293 - Flags: review?(glob)
Comment on attachment 832293 [details] [diff] [review] Patch v.2 The code looks good, but you must document this hook in Bugzilla/Hook.pm and add an example in extensions/Example/Extension.pm.
Attachment #832293 - Flags: review?(glob) → review-
Attached patch Patch v.3Splinter Review
Thank you. Here is a patch with documentation. Gerv
Attachment #832293 - Attachment is obsolete: true
Attachment #832331 - Flags: review?(LpSolit)
Comment on attachment 832331 [details] [diff] [review] Patch v.3 r=LpSolit
Attachment #832331 - Flags: review?(LpSolit) → review+
Flags: approval?
Keywords: relnote
Target Milestone: --- → Bugzilla 5.0
Flags: approval? → approval+
Gerv forgot to close this bug 3 days ago (and to paste the revision number!). Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/CGI.pm modified Bugzilla/Hook.pm modified extensions/Example/Extension.pm Committed revision 8820.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Oops, sorry. Thank you! Gerv
remove tabs: Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/ modified extensions/Example/Extension.pm Committed revision 8822.
Added to relnotes for 5.0rc1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: