Skip to content

Commit

Permalink
user agent for api
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Jul 28, 2024
1 parent d9ff550 commit 1141fb2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Service/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ protected static function payloadJson(Task $task, Discord $discord, array $param
return [
'method' => 'POST',
'headers' => [
'Authorization' => $discord->token()
'Authorization' => $discord->token(),
'User-Agent' => $discord->useragent(),
],
'data' => [
'payload_json' => json_encode($params)
Expand All @@ -60,7 +61,8 @@ protected static function json(Task $task, Discord $discord, array $params)
'method' => 'POST',
'headers' => [
'Authorization' => $discord->token(),
'Content-Type' => 'application/json'
'Content-Type' => 'application/json',
'User-Agent' => $discord->useragent(),
],
'data' => json_encode($params),
'success' => function ($response) use ($task, $discord) {
Expand Down Expand Up @@ -131,7 +133,8 @@ public static function varyRegion(Task $task, Discord $discord)
'method' => 'POST',
'headers' => [
'Authorization' => $discord->token(),
'Content-Type' => 'application/json'
'Content-Type' => 'application/json',
'User-Agent' => $discord->useragent(),
],
'data' => json_encode($params),
'success' => function ($response) use ($task, $discord) {
Expand All @@ -154,7 +157,8 @@ public static function cancelJob(Task $task, Discord $discord)
'method' => 'POST',
'headers' => [
'Authorization' => $discord->token(),
'Content-Type' => 'application/json'
'Content-Type' => 'application/json',
'User-Agent' => $discord->useragent(),
],
'data' => json_encode($params),
'success' => function ($response) use ($task, $discord) {
Expand Down

0 comments on commit 1141fb2

Please sign in to comment.