Incorrect Content-Type sent when POSTing Safari Push Notification errors

Originator:Adam.V.Duke
Number:rdar://15586918 Date Originated:04-Dec-2013 04:45
Status:Closed Resolved:Duplicate of 14967488
Product:Safari Product Version:
Classification: Reproducible:Always
 
The implementation of Safari push notifications requires the website to create a url where Apple/Safari can POST error messages. The content that Apple sends is a JSON object that contains details about possible errors that exist within the user's website and it's use of the push notification feature.

When Apple/Safari sends this POST request, the content-type sent is 'application/x-www-form-urlencoded', however it should be 'application/json' based on the actual content.

Certain web servers attempt to parse the incoming POST body based on the content-type header and the parse operation fails because the request's content cannot be parsed as 'application/x-www-form-urlencoded' data.

Steps to Reproduce:
1. Create a website that implements Safari Push notifications.
2. Send a push notification with the incorrect number of 'url-args' based on the application's urlFormatString.
3. Monitor the incoming traffic from Apple regarding the push notification errors.
4. The content-type of the incoming request will be incorrect

Expected Results:
The content will be a JSON message similar to:

{"logs":["Notification arguments [1] mismatches format string https:\/\/zeropush.com\/safari?%@=%@"]}

The Content-Type of the incoming request will be application/json

Actual Results:
The content will be a JSON message similar to:

{"logs":["Notification arguments [1] mismatches format string https:\/\/zeropush.com\/safari?%@=%@"]}

The Content-Type of the incoming request will be application/x-www-form-urlencoded

Version:
SafariNotificationAgent (unknown version) CFNetwork/673.0.3 Darwin/13.0.0 (x86_64) (MacBookPro5,1)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!