fix: pass http errors while polling to the UI

This commit is contained in:
Benjamin Nussbaum 2025-07-03 00:03:46 +02:00
parent e326ded933
commit b438457d32
2 changed files with 13 additions and 35 deletions

View file

@ -43,7 +43,7 @@ class Plugin extends Model
public function updateDataPayload(): void
{
if ($this->data_strategy === 'polling' && $this->polling_url) {
// Parse headers from polling_header string
$headers = ['User-Agent' => 'usetrmnl/byos_laravel', 'Accept' => 'application/json'];
if ($this->polling_header) {
@ -58,7 +58,6 @@ class Plugin extends Model
$httpRequest = Http::withHeaders($headers);
// Add body for POST requests if polling_body is provided
if ($this->polling_verb === 'post' && $this->polling_body) {
$httpRequest = $httpRequest->withBody($this->polling_body);
}