Bug 7245

Summary: send-error-report tool data in post body rather than param
Product: [Yocto Project Subprojects] Error Reporting tool Reporter: Michael Wood <michael.g.wood>
Component: Error Reporting ToolAssignee: Michael Wood <michael.g.wood>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium    
Version: unspecified   
Target Milestone: 1.8   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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