Closed Bug 1496570 Opened 6 years ago Closed 6 years ago

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

Categories

(bugzilla.mozilla.org :: API, defect, P1)

Production
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ericz, Assigned: dylan)

References

Details

Attachments

(1 file)

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)
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
Status: NEW → ASSIGNED
Summary: Possible API regression? → Bugzilla doesn't attempt to decode form-urlencoded data without a content-type header
Version: Staging → Production
Attached file GitHub Pull Request
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
Closed: 6 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: