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

Fix the use of Joomla\Http\Response #20

Open
wants to merge 4 commits into
base: 2.0-dev
Choose a base branch
from

Conversation

SharkyKZ
Copy link

Summary of Changes

Fixes the use Joomla\Http\Response where the values of individual headers are stored as arrays since v2 of the joomla/http package. Closes #19.
Updates to use joomla/http v2 syntax only since v1 support was dropped for some reason in 59268f5.
Updates tests to also use Joomla\Http\Response class (the use of stdClass is what allowed the error to slip by).

Testing Instructions

Use the class. Before patch, TypeError is thrown in src\Client.php:116 on PHP 8:

strpos(): Argument #1 ($haystack) must be of type string, array given 

On older PHP versions, a warning is emitted and JSON header detection always fails:

Warning: strpos() expects parameter 1 to be string, array given

Documentation Changes Required

No.

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.

Content-Type header check is not case insensitive, again
1 participant