class ContentLength
Same name in this branch
- 11.1.x core/lib/Drupal/Core/StackMiddleware/ContentLength.php \Drupal\Core\StackMiddleware\ContentLength
Defines a big pipe middleware that removes Content-Length headers.
Hierarchy
- class \Drupal\big_pipe\StackMiddleware\ContentLength implements \Symfony\Component\HttpKernel\HttpKernelInterface
Expanded class hierarchy of ContentLength
1 string reference to 'ContentLength'
- big_pipe.services.yml in core/
modules/ big_pipe/ big_pipe.services.yml - core/modules/big_pipe/big_pipe.services.yml
1 service uses ContentLength
- http_middleware.big_pipe in core/
modules/ big_pipe/ big_pipe.services.yml - \Drupal\big_pipe\StackMiddleware\ContentLength
File
-
core/
modules/ big_pipe/ src/ StackMiddleware/ ContentLength.php, line 15
Namespace
Drupal\big_pipe\StackMiddlewareView source
final class ContentLength implements HttpKernelInterface {
/**
* Constructs a new ContentLength instance.
*
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel
* The wrapped HTTP kernel.
*/
public function __construct(HttpKernelInterface $httpKernel) {
}
/**
* {@inheritdoc}
*/
public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) : Response {
$response = $this->httpKernel
->handle($request, $type, $catch);
if (!$response instanceof BigPipeResponse) {
return $response;
}
$response->headers
->remove('Content-Length');
return $response;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ContentLength::handle | public | function | Handles a Request to convert it to a Response. | Overrides HttpKernelInterface::handle |
ContentLength::__construct | public | function | Constructs a new ContentLength instance. | |
HttpKernelInterface::MAIN_REQUEST | public | constant | ||
HttpKernelInterface::SUB_REQUEST | public | constant |