diff --git a/src/Middleware.php b/src/Middleware.php index 24caf9ad..ba4d9a34 100644 --- a/src/Middleware.php +++ b/src/Middleware.php @@ -29,15 +29,15 @@ class Middleware public function version(Request $request) { if (config('app.asset_url')) { - return md5(config('app.asset_url')); + return hash('xxh128', config('app.asset_url')); } if (file_exists($manifest = public_path('mix-manifest.json'))) { - return md5_file($manifest); + return hash_file('xxh128', $manifest); } if (file_exists($manifest = public_path('build/manifest.json'))) { - return md5_file($manifest); + return hash_file('xxh128', $manifest); } return null; diff --git a/tests/ResponseFactoryTest.php b/tests/ResponseFactoryTest.php index 50d2c78b..ba1bd91a 100644 --- a/tests/ResponseFactoryTest.php +++ b/tests/ResponseFactoryTest.php @@ -109,7 +109,7 @@ public function test_the_version_can_be_a_closure(): void $this->assertSame('', Inertia::getVersion()); Inertia::version(function () { - return md5('Inertia'); + return hash('xxh128', 'Inertia'); }); return Inertia::render('User/Edit'); @@ -117,7 +117,7 @@ public function test_the_version_can_be_a_closure(): void $response = $this->withoutExceptionHandling()->get('/', [ 'X-Inertia' => 'true', - 'X-Inertia-Version' => 'b19a24ee5c287f42ee1d465dab77ab37', + 'X-Inertia-Version' => 'f445bd0a2c393a5af14fc677f59980a9', ]); $response->assertSuccessful();