diff options
| author | winter | 2024-12-17 21:04:20 +0000 |
|---|---|---|
| committer | winter | 2024-12-17 21:04:20 +0000 |
| commit | c58caced838a9a7954e7fefa60c01567bb6bc107 (patch) | |
| tree | c68d6bb8f7c8b9636485e3f52f9a7b856316e0de /Digitigrade/Model/Instance.php | |
| parent | 10793d22df72f12f2f14c730c09b5018b5b6e63a (diff) | |
winter REPORTEDLY forgot to implement subscribe routes
Diffstat (limited to 'Digitigrade/Model/Instance.php')
| -rw-r--r-- | Digitigrade/Model/Instance.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Digitigrade/Model/Instance.php b/Digitigrade/Model/Instance.php index 2fc2f17..168a1de 100644 --- a/Digitigrade/Model/Instance.php +++ b/Digitigrade/Model/Instance.php @@ -143,10 +143,12 @@ class Instance extends FetchableModel { throw new \RuntimeException("can't (un)subscribe to $this->domain because i don't have an outbound token for it"); } $context = stream_context_create(['http' => [ + 'method' => 'POST', 'header' => 'Authorization: Bearer ' . $this->auth->outboundToken ]]); file_get_contents($isUnsubscribe ? $this->endpoints->unsubscribe : $this->endpoints->subscribe, context: $context); - return str_contains($http_response_header[0], '200'); + // it ought to return 204 but i'll allow 200 for compatibility's sake + return str_contains($http_response_header[0], '204') || str_contains($http_response_header[0], '200'); } /** |
