Bug 7245 - send-error-report tool data in post body rather than param
Summary: send-error-report tool data in post body rather than param
Status: RESOLVED FIXED
Alias: None
Product: Error Reporting tool
Classification: Yocto Project Subprojects
Component: Error Reporting Tool (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 1.8
Assignee: Michael Wood
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-01-23 15:53 UTC by Michael Wood
Modified: 2015-03-27 14:40 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wood 2015-01-23 15:53:27 UTC
Newer versions of django handle application/json in a more correct way by having the payload in the request body rather than a url parameter to the HTTP post request.

see https://docs.djangoproject.com/en/dev/releases/1.5/section #non-form-data-in-http-requests

We can therefore remove the:
    -    params = urllib.urlencode({'data': data})

As we should not be sending a body with a url as the content rather we can correctly send the application/json as the body and pass the data directly.
     
     - conn.request("POST", "http://%s/ClientPost/" % server, params, headers)
     + conn.request("POST", "http://%s/ClientPost/" % server, data, headers)

Compatibility has been added to the error-report-web so that we can handle this transition but we should deprecate it in future versions.
Comment 1 Michael Wood 2015-03-27 14:40:57 UTC
893be80139e10819911431a68ce7ff9e237e8e89   

views/tests: Add a user-agent path to switch payload decode paths