If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Bugzilla does not send correct Content-Type for JSON template

RESOLVED FIXED in Bugzilla 3.6

Status

()

Bugzilla
Extensions
--
enhancement
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gerv, Assigned: gerv)

Tracking

Bugzilla 3.6
Bug Flags:
approval +
approval3.6 +

Details

(Whiteboard: bzapi)

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
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
(Assignee)

Comment 1

7 years ago
Created attachment 447769 [details] [diff] [review]
Patch v.1

Trivial patch.

Gerv
Assignee: extensions → gerv
Status: NEW → ASSIGNED
Attachment #447769 - Flags: review?(mkanat)

Comment 2

7 years ago
Comment on attachment 447769 [details] [diff] [review]
Patch v.1

Reasonable.
Attachment #447769 - Flags: review?(mkanat) → review+

Updated

7 years ago
Flags: approval3.6+
Flags: approval+
Target Milestone: --- → Bugzilla 3.6
(Assignee)

Comment 3

7 years ago
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
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.