Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
44 foreach ($this->formats as $format => $mime_type) { | 44 foreach ($this->formats as $format => $mime_type) { |
45 $request->setFormat($format, $mime_type); | 45 $request->setFormat($format, $mime_type); |
46 } | 46 } |
47 | 47 |
48 // Determine the request format using the negotiator. | 48 // Determine the request format using the negotiator. |
49 $request->setRequestFormat($this->getContentType($request)); | 49 if ($requested_format = $this->getContentType($request)) { |
50 $request->setRequestFormat($requested_format); | |
51 } | |
50 return $this->app->handle($request, $type, $catch); | 52 return $this->app->handle($request, $type, $catch); |
51 } | 53 } |
52 | 54 |
53 /** | 55 /** |
54 * Registers a format for a given MIME type. | 56 * Registers a format for a given MIME type. |
86 | 88 |
87 if ($request->query->has('_format')) { | 89 if ($request->query->has('_format')) { |
88 return $request->query->get('_format'); | 90 return $request->query->get('_format'); |
89 } | 91 } |
90 | 92 |
91 // Do HTML last so that it always wins. | 93 // No format was specified in the request. |
92 return 'html'; | 94 return NULL; |
93 } | 95 } |
94 | 96 |
95 } | 97 } |