Closed Bug 568500 Opened 14 years ago Closed 14 years ago

Bugzilla does not send correct Content-Type for JSON template

Categories

(Bugzilla :: Extensions, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: gerv, Assigned: gerv)

Details

(Whiteboard: bzapi)

Attachments

(1 file)

Bugzilla can be extended in a supported fashion by dropping in new templates.
http://www.bugzilla.org/docs/tip/en/html/cust-templates.html

The template to be used for a given request is chosen using the "ctype" parameter. However, Bugzilla currently only knows the correct Content Type for a few ctypes. The list is in Bugzilla/Constants.pm, the constant "contenttypes". 

It knows: html, rdf, atom, xml, js, csv, png and ics.

If an admin adds a new template which is not one of those types, Bugzilla will not send a Content-Type at all. :-(( This means that, among other things, client software may default to guessing the type as text/html and also the charset as ISO-8859-1, both of which are incorrect, and the latter of which could lead to data corruption.

For these reasons Bugzilla should know about a good set of common content types admins may use. In particular, JSON.

Gerv
Attached patch Patch v.1Splinter Review
Trivial patch.

Gerv
Assignee: extensions → gerv
Status: NEW → ASSIGNED
Attachment #447769 - Flags: review?(mkanat)
Comment on attachment 447769 [details] [diff] [review]
Patch v.1

Reasonable.
Attachment #447769 - Flags: review?(mkanat) → review+
Flags: approval3.6+
Flags: approval+
Target Milestone: --- → Bugzilla 3.6
http://bzr.mozilla.org/bugzilla/3.6/revision/7103
http://bzr.mozilla.org/bugzilla/trunk/revision/7200

(I've fixed the bug in my scripts which seems to have recorded the author as ''.)

Gerv
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: