Simplify this

This commit is contained in:
Lance Pioch 2024-03-16 18:53:20 -04:00
parent 4969aed383
commit 9b2dfb4212

View File

@ -52,12 +52,12 @@ class AppServiceProvider extends ServiceProvider
Http::macro( Http::macro(
'daemon', 'daemon',
fn (Node $node, array $headers = []) => Http::acceptJson()->withHeaders([ fn (Node $node, array $headers = []) => Http::acceptJson()
'Authorization' => 'Bearer ' . $node->getDecryptedKey(), ->withToken($node->getDecryptedKey())
] + $headers) ->withHeaders($headers)
->withOptions(['verify' => (bool) app()->environment('production')]) ->withOptions(['verify' => (bool) app()->environment('production')])
->timeout(config('pterodactyl.guzzle.timeout')) ->timeout(config('panel.guzzle.timeout'))
->connectTimeout(config('pterodactyl.guzzle.connect_timeout')) ->connectTimeout(config('panel.guzzle.connect_timeout'))
->baseUrl($node->getConnectionAddress()) ->baseUrl($node->getConnectionAddress())
); );
} }