Skip to content
This repository
Browse code

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 authored May 30, 2012

Showing 1 changed file with 2 additions and 12 deletions. Show diff stats Hide diff stats

  1. 14  control/PjaxResponseNegotiator.php
14  control/PjaxResponseNegotiator.php
@@ -53,18 +53,8 @@ public function respond(SS_HTTPRequest $request, $extraCallbacks = array()) {
53 53
 					throw new SS_HTTPResponse_Exception("X-Pjax = '$fragment' not supported for this URL.", 400);
54 54
 				}
55 55
 			}
56  
-			if(count($responseParts) == 1) {
57  
-				$response->setBody(array_pop($responseParts));
58  
-			} else {
59  
-				if($request->getHeader('Accept') != 'text/json') {
60  
-					throw new SS_HTTPResponse_Exception(
61  
-						'Multiple comma-separated fragments can only be returne with an "Accept: text/json" header',
62  
-						400
63  
-					);
64  
-				}
65  
-				$response->setBody(Convert::raw2json($responseParts));
66  
-				$response->addHeader('Content-Type', 'text/json');
67  
-			}
  56
+			$response->setBody(Convert::raw2json($responseParts));
  57
+			$response->addHeader('Content-Type', 'text/json');
68 58
 		} else {
69 59
 			if($request->isAjax()) throw new SS_HTTPResponse_Exception("Ajax requests to this URL require an X-Pjax header.", 400);
70 60
 			$response->setBody(call_user_func($callbacks['default']));

0 notes on commit 1102bbd

Please sign in to comment.
Something went wrong with that request. Please try again.