Remove uneeded usages of nosniff
This commit is contained in:
parent
a2a850dd91
commit
b04d95b116
|
@ -119,8 +119,6 @@ class OC_JSON{
|
||||||
* Encode and print $data in json format
|
* Encode and print $data in json format
|
||||||
*/
|
*/
|
||||||
public static function encodedPrint($data, $setContentType=true) {
|
public static function encodedPrint($data, $setContentType=true) {
|
||||||
// Disable mimesniffing, don't move this to setContentTypeHeader!
|
|
||||||
header( 'X-Content-Type-Options: nosniff' );
|
|
||||||
if($setContentType) {
|
if($setContentType) {
|
||||||
self::setContentTypeHeader();
|
self::setContentTypeHeader();
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ class JSONResponse extends Response {
|
||||||
public function __construct($data=array(), $statusCode=Http::STATUS_OK) {
|
public function __construct($data=array(), $statusCode=Http::STATUS_OK) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
$this->setStatus($statusCode);
|
$this->setStatus($statusCode);
|
||||||
$this->addHeader('X-Content-Type-Options', 'nosniff');
|
|
||||||
$this->addHeader('Content-type', 'application/json; charset=utf-8');
|
$this->addHeader('Content-type', 'application/json; charset=utf-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,13 +79,6 @@ class JSONResponseTest extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertEquals($expected, $this->json->render());
|
$this->assertEquals($expected, $this->json->render());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testShouldHaveXContentHeaderByDefault() {
|
|
||||||
$headers = $this->json->getHeaders();
|
|
||||||
$this->assertEquals('nosniff', $headers['X-Content-Type-Options']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function testConstructorAllowsToSetData() {
|
public function testConstructorAllowsToSetData() {
|
||||||
$data = array('hi');
|
$data = array('hi');
|
||||||
$code = 300;
|
$code = 300;
|
||||||
|
|
Loading…
Reference in New Issue