Disable mimesniffing
This commit is contained in:
parent
b2cb7d54d1
commit
4e63981da9
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +96,8 @@ 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();
|
||||
}
|
||||
|
@ -102,4 +105,3 @@ class OC_JSON{
|
|||
echo json_encode($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue