mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix: send user agent when fetching data, accept json
This commit is contained in:
parent
f03fff5784
commit
09b0d8bcf8
1 changed files with 4 additions and 1 deletions
|
|
@ -42,7 +42,10 @@ class Plugin extends Model
|
|||
public function updateDataPayload(): void
|
||||
{
|
||||
if ($this->data_strategy === 'polling' && $this->polling_url) {
|
||||
$response = Http::get($this->polling_url)->json();
|
||||
$response = Http::withHeaders(['User-Agent' => 'usetrmnl/byos_laravel', 'Accept' => 'application/json'])
|
||||
->get($this->polling_url)
|
||||
->json();
|
||||
|
||||
$this->update([
|
||||
'data_payload' => $response,
|
||||
'data_payload_updated_at' => now(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue