mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix: pass http errors while polling to the UI
This commit is contained in:
parent
e326ded933
commit
b438457d32
2 changed files with 13 additions and 35 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue