Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-06-11 03:20:09 +0400
committerBernhard Posselt <dev@bernhard-posselt.com>2014-06-11 03:20:09 +0400
commit93169eca1e754bf9a91599f7a7a84e461cfd974f (patch)
tree58298835ff454b93d2975494e0cc3493a6c01d2d /lib/public
parent0252d39bb6b1e659b03840c5a1a599d90a92c291 (diff)
also handle lowercase headers
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/appframework/controller.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php
index b3bff5e05f5..b22eb73343a 100644
--- a/lib/public/appframework/controller.php
+++ b/lib/public/appframework/controller.php
@@ -70,28 +70,28 @@ abstract class Controller {
}
- /**
- * Parses an HTTP accept header and returns the supported responder type
- * @param string $acceptHeader
- * @return string the responder type
- */
- public function getResponderByHTTPHeader($acceptHeader) {
- $headers = explode(',', $acceptHeader);
-
- // return the first matching responder
- foreach ($headers as $header) {
- $header = trim($header);
-
- $responder = str_replace('application/', '', $header);
-
- if (array_key_exists($responder, $this->responders)) {
- return $responder;
- }
- }
-
- // no matching header defaults to json
- return 'json';
- }
+ /**
+ * Parses an HTTP accept header and returns the supported responder type
+ * @param string $acceptHeader
+ * @return string the responder type
+ */
+ public function getResponderByHTTPHeader($acceptHeader) {
+ $headers = explode(',', $acceptHeader);
+
+ // return the first matching responder
+ foreach ($headers as $header) {
+ $header = strtolower(trim($header));
+
+ $responder = str_replace('application/', '', $header);
+
+ if (array_key_exists($responder, $this->responders)) {
+ return $responder;
+ }
+ }
+
+ // no matching header defaults to json
+ return 'json';
+ }
/**