Fix styling
This commit is contained in:
1 parent
26454a9501
commit
164c3ab5dd
2 files changed
+2
-4
No files matched your search
+1
-1
@@ -26,7 +26,7 @@ Route::post('api/event', function (Request $request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$headers = collect($request->headers->all())
|
$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();
|
->all();
|
||||||
|
|
||||||
Http::withHeaders($headers)->post(config('plausible-proxy.domain').'/api/event', $data);
|
Http::withHeaders($headers)->post(config('plausible-proxy.domain').'/api/event', $data);
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ it('accepts valid event data and forwards headers', function () {
|
|||||||
'https://plausible.io/api/event' => function ($request) {
|
'https://plausible.io/api/event' => function ($request) {
|
||||||
dump($request->headers());
|
dump($request->headers());
|
||||||
dump($request->data());
|
dump($request->data());
|
||||||
|
|
||||||
return Http::response(['status' => 'queued'], 200);
|
return Http::response(['status' => 'queued'], 200);
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
'User-Agent' => 'TestAgent',
|
'User-Agent' => 'TestAgent',
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
@@ -88,5 +88,3 @@ it('accepts valid event data and forwards headers', function () {
|
|||||||
&& isset($request['d']) && $request['d'] === 'example.com';
|
&& isset($request['d']) && $request['d'] === 'example.com';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user