From 164c3ab5ddae95fe7244bb2002af9f2bc2d406fa Mon Sep 17 00:00:00 2001 From: mathiaspalmqvist <51116221+mathiaspalmqvist@users.noreply.github.com> Date: Fri, 31 Jan 2025 11:36:31 +0000 Subject: [PATCH] Fix styling --- routes/api.php | 2 +- tests/PlausibleProxyTest.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/routes/api.php b/routes/api.php index 201cbd5..6799a28 100644 --- a/routes/api.php +++ b/routes/api.php @@ -26,7 +26,7 @@ Route::post('api/event', function (Request $request) { } $headers = collect($request->headers->all()) - ->mapWithKeys(fn($value, $key) => [$key => is_array($value) ? implode(', ', $value) : $value]) + ->mapWithKeys(fn ($value, $key) => [$key => is_array($value) ? implode(', ', $value) : $value]) ->all(); Http::withHeaders($headers)->post(config('plausible-proxy.domain').'/api/event', $data); diff --git a/tests/PlausibleProxyTest.php b/tests/PlausibleProxyTest.php index a6c94f5..157d4cc 100644 --- a/tests/PlausibleProxyTest.php +++ b/tests/PlausibleProxyTest.php @@ -56,11 +56,11 @@ it('accepts valid event data and forwards headers', function () { 'https://plausible.io/api/event' => function ($request) { dump($request->headers()); dump($request->data()); + return Http::response(['status' => 'queued'], 200); }, ]); - $headers = [ 'User-Agent' => 'TestAgent', 'Accept' => 'application/json', @@ -88,5 +88,3 @@ it('accepts valid event data and forwards headers', function () { && isset($request['d']) && $request['d'] === 'example.com'; }); }); - -