1
votes

I'm attempting to make an http post from a simple web page to a SharePoint server. This request is already working on Internet Explorer but fails on Chrome.

$.ajax({
    url:"http://redacted/_vti_bin/cellstorage.svc/CellStorageService",
    type:'POST',
    headers:{
     'MIME-Version': "1.0",
     'SOAPAction': "http://schemas.microsoft.com/sharepoint/soap/ICellStorages/ExecuteCellStorageRequest",
     'Content-Type': "multipart/related; type=\"application/xop+xml\"; boundary=\"urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2\"; start=\"<[email protected]>\"; start-Info=\"text/xml; charset=utf-8\"",
     'X-Vermeer-Content-Type': "application/x-www-form-urlencoded"
    },

My tests show that the webservice I'm contacting (/_vti_bin/cellstorage.svc/CellStorageService) will fail unless the request header case is left unchanged:

Content-Type: multipart/related; type="application/xop+xml"; boundary="urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2"; start="[email protected]"; start-Info="text/xml; charset=utf-8"

However, Chrome seems to automatically convert the request header value from "utf-8" to "UTF-8", which can be confirmed through the fiddler output. This causes an error:

POST http://redacted/_vti_bin/cellstorage.svc/CellStorageService 400 (Bad Request)

enter image description here

Content-Type: multipart/related; type="application/xop+xml"; boundary="urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2"; start="[email protected]"; start-Info="text/xml; charset=UTF-8"

Since I can't really change the server service, I wonder if there is a way to force Chrome to use lowercase header values instead of converting them.

Similar posts:

Why does Header Content-Type for POST request differ between chrome and firefox only in by "UTF-8" vs "utf-8"?

1

1 Answers

0
votes

This caused issue with amazon aws authentication (GetFederationToken) issue on chrome but not firefox or IE, since it is used as signed header signature, I spent hours and tracked down this, hope this save other people when running into signature mismatch problem

I don't think there is any reason chrome choose uppercase UTF-8:

https://www.w3.org/International/questions/qa-html-encoding-declarations