From 3e6b903cc4ba8f4a56d772e443ec9dc877f0aad4 Mon Sep 17 00:00:00 2001 From: Andrew Maxwell Date: Fri, 22 Mar 2019 16:35:01 -0700 Subject: [PATCH] Update HttpPush.php When using `mix.version()`, `getTypeByExtension()` does not take into account the query string on the url and improperly marks all versioned assets as `image`. To fix, split `$resourcePath` by `?` to give us a clean, non-versioned asset url, which we can then split by `.` to get the correct file extension. --- src/HttpPush.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HttpPush.php b/src/HttpPush.php index 73dda41..f8d5792 100644 --- a/src/HttpPush.php +++ b/src/HttpPush.php @@ -69,7 +69,7 @@ public function clear() */ public static function getTypeByExtension(string $resourcePath) : string { - $parts = explode('.', $resourcePath); + $parts = explode('.', explode('?', $resourcePath)[0]); $extension = end($parts); switch ($extension) { case 'css': return 'style';