Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Removed ability in PjaxResponseNegotiator to send non-JSON resp…

…onses for single fragments, as we're now relying on the server communicating which segment needs replacement (through the JSON key)
  • Loading branch information...
commit 1102bbdf17e40ec88d2da92d05250f711f503eb8 1 parent 75e51de
Ingo Schommer chillu authored
Showing with 2 additions and 12 deletions.
  1. +2 −12 control/PjaxResponseNegotiator.php
14 control/PjaxResponseNegotiator.php
View
@@ -53,18 +53,8 @@ public function respond(SS_HTTPRequest $request, $extraCallbacks = array()) {
throw new SS_HTTPResponse_Exception("X-Pjax = '$fragment' not supported for this URL.", 400);
}
}
- if(count($responseParts) == 1) {
- $response->setBody(array_pop($responseParts));
- } else {
- if($request->getHeader('Accept') != 'text/json') {
- throw new SS_HTTPResponse_Exception(
- 'Multiple comma-separated fragments can only be returne with an "Accept: text/json" header',
- 400
- );
- }
- $response->setBody(Convert::raw2json($responseParts));
- $response->addHeader('Content-Type', 'text/json');
- }
+ $response->setBody(Convert::raw2json($responseParts));
+ $response->addHeader('Content-Type', 'text/json');
} else {
if($request->isAjax()) throw new SS_HTTPResponse_Exception("Ajax requests to this URL require an X-Pjax header.", 400);
$response->setBody(call_user_func($callbacks['default']));
Please sign in to comment.
Something went wrong with that request. Please try again.