From 4e1ea8b8831f0138ff1ccd17bb4996d1e9e37f02 Mon Sep 17 00:00:00 2001 From: Matthew Rhodes Date: Mon, 31 Oct 2016 21:43:13 -0400 Subject: [PATCH] Update readme to add middleware to web group Middleware should be in the web group and not global as assets do not normally get pushed from API's and most REST clients do not support HTTP2 Push in the first place. --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de9208d..7c2b602 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,18 @@ You can install the package via composer: $ composer require jacobbennett/laravel-http2serverpush ``` -Next you must add the `\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush`-middleware to the kernel. +Next you must add the `\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush`-middleware to the kernel. Adding it to the web group is recommeneded as API's do not have assets to push. ```php // app/Http/Kernel.php ... -protected $middleware = [ +protected $middlewareGroups = [ + 'web' => [ + ... + \JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush::class, + ... + ], ... - \JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush::class, ]; ```