Skip to content
Snippets Groups Projects
Commit fa7d4c2b authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Disable mimesniffing

parent 9c083d35
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ class OC_JSON{
if (!self::$send_content_type_header){
// We send json data
header( 'Content-Type: '.$type );
// Force download
header( 'Content-Disposition: attachment' );
self::$send_content_type_header = true;
}
}
......@@ -85,11 +87,11 @@ class OC_JSON{
* Encode and print $data in json format
*/
public static function encodedPrint($data,$setContentType=true){
if(!isset($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO'] == '') {
// Disable mimesniffing, don't move this to setContentTypeHeader!
header( 'X-Content-Type-Options: nosniff' );
if($setContentType){
self::setContentTypeHeader();
}
echo json_encode($data);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment