Details
-
Improvement
-
Status: Patch Available
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The JSONResponseWriter handles two purposes:
- writing JSON responses (wt=json)
- writing JSONP responses, namely JSON responses wrapped by a JavaScript function (wt=json&json.wrf=myFunction)
The response writer returns the same Content-Type in both cases. (default: application/json)
But for JSONP the correct Content-Type would be "application/javascript".
The response type is configurable, but it is currently not possible to return the correct Content-Type in both cases with one configuration at the same time.
The attached patch changes the default Content-Type to application/javascript; charset=utf-8 for responses with wrapper functions (JSONP). If param content-type is configured, this Content-Type will be returned for both JSON and JSONP to ensure backward compatibility.
Attachments
Attachments
Issue Links
- relates to
-
SOLR-12292 Make it easier to configure Solr with CORS
- Open
-
SOLR-1123 Change the JSONResponseWriter content type
- Closed