Bugzilla doesn't attempt to decode form-urlencoded data without a content-type header

VERIFIED FIXED

Status

()

defect
P1
normal
VERIFIED FIXED
7 months ago
7 months ago

People

(Reporter: ericz, Assigned: dylan)

Tracking

Production

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 months ago
We have a script that synchronizes some data from Bugzilla to another service and it is currently logging this error:

[Thu Oct 04 20:00:18 2018] [ERROR] Error no=32000 talking to bugzilla: Could not parse the 'params' argument as valid JSON. Error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "assigned_to=Rob@mozi...") at /app/Bugzilla/WebService/Server/REST.pm line 377. Value:

which I was told may be a bugzilla regression hence this bug.
Can you add the query you're using to fetch the data, and make the bug MoCo private if necessary?
Flags: needinfo?(eziegenhorn)
(Assignee)

Comment 2

7 months ago
369 out of 14,273,121 requests seem to exhibit this bug.

We're going to get a fix out tomorrow, before Pacific Coast wakes up anyway.
Assignee: nobody → dylan
Priority: -- → P1
Component: General → API
(Assignee)

Updated

7 months ago
Status: NEW → ASSIGNED
Summary: Possible API regression? → Bugzilla doesn't attempt to decode form-urlencoded data without a content-type header
Version: Staging → Production
(Assignee)

Comment 3

7 months ago
Posted file GitHub Pull Request
(Assignee)

Comment 4

7 months ago
The fix here is -- for the legacy CGI controller -- to assume 'application/x-www-form-urlencoded; charset=utf-8' when no content-type is present.
Merged to master.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
(Reporter)

Comment 6

7 months ago
Works for me now, thanks!  FWIW it took a while to track down but the app makes a POST to e.g. https://bugzilla.mozilla.org/rest/bug/1495719 with content like:

'assigned_to=johndoe@mozilla.com&token=23925-JfIavher'
Status: RESOLVED → VERIFIED
Flags: needinfo?(eziegenhorn)
You need to log in before you can comment on or make changes to this bug.