Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty 204 Requests returned by CCP's PUT and DELETE methods #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Handle empty 204 Requests returned by CCP's PUT and DELETE methods #2

wants to merge 1 commit into from

Conversation

PeterDKC
Copy link

ESI returns HTTP 204 responses for PUT and DELETE operations.

image

There's a deficiency in the base oauth2 library that sends empty response bodies to json_decode(), which then throws an UnexpectedValueException even though the request has succeeded and returned a 2xx ( 204 in this case ) response status code.

This workaround solves the issue:

+        if (empty($content) && $response->getStatusCode() === 204) {
+            return $content;
+        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant