mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8327 from dhensby/pulls/4/application-json
FIX text/json is not a valid mimetype
This commit is contained in:
commit
735c87b709
@ -103,7 +103,7 @@ class PjaxResponseNegotiator
|
||||
}
|
||||
}
|
||||
$response->setBody(Convert::raw2json($responseParts));
|
||||
$response->addHeader('Content-Type', 'text/json');
|
||||
$response->addHeader('Content-Type', 'application/json');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
}
|
||||
Config::unnest();
|
||||
$response = new HTTPResponse(Convert::array2json($json));
|
||||
$response->addHeader('Content-Type', 'text/json');
|
||||
$response->addHeader('Content-Type', 'application/json');
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ class PjaxResponseNegotiatorTest extends SapphireTest
|
||||
$request = new HTTPRequest('GET', '/');
|
||||
$request->setSession(new Session([]));
|
||||
$request->addHeader('X-Pjax', 'myfragment,otherfragment');
|
||||
$request->addHeader('Accept', 'text/json');
|
||||
$request->addHeader('Accept', 'application/json');
|
||||
$response = $negotiator->respond($request);
|
||||
$json = json_decode($response->getBody());
|
||||
$this->assertObjectHasAttribute('myfragment', $json);
|
||||
@ -87,7 +87,7 @@ class PjaxResponseNegotiatorTest extends SapphireTest
|
||||
$request = new HTTPRequest('GET', '/');
|
||||
$request->setSession(new Session([]));
|
||||
$request->addHeader('X-Pjax', 'alpha');
|
||||
$request->addHeader('Accept', 'text/json');
|
||||
$request->addHeader('Accept', 'application/json');
|
||||
|
||||
$response = $negotiator->setFragmentOverride(array('beta'))->respond($request);
|
||||
$json = json_decode($response->getBody());
|
||||
|
Loading…
Reference in New Issue
Block a user