Skip to content

Commit

Permalink
fix bug when js resolve via php
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed May 6, 2021
1 parent 2047d93 commit d459dca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Middleware/InjectScriptsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;

class InjectScriptsMiddleware
{
Expand All @@ -17,6 +18,7 @@ public function handle(Request $request, Closure $next)
if (
Cache::get('serve_websockets_running') === true
&& $request->getMethod() === Request::METHOD_GET
&& Str::startsWith($response->headers->get('Content-Type'), 'text/html')
&& !$request->isXmlHttpRequest()
&& !$response instanceof JsonResponse
) {
Expand Down

0 comments on commit d459dca

Please sign in to comment.