Skip to content

fix: prevent null respect_response_cache_directives #415

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

Closed
wants to merge 1 commit into from

Conversation

qkdreyer
Copy link
Contributor

@qkdreyer qkdreyer commented Apr 22, 2022

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets
Documentation
License MIT

What's in this PR?

It prevents respect_response_cache_directives configuration key to be null, in order to prevent PHP error array_intersect(): Argument #1 ($array) must be of type array, null given

Why?

image

Example Usage

N/A

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

@ostrolucky
Copy link
Collaborator

Isn't having null there meant as "respect any cache header directives", which is clearly different from "respect no cache header directives"?

@dbu
Copy link
Collaborator

dbu commented Apr 25, 2022

thanks @qkdreyer for this MR. there is indeed something wrong when we get php warnings.

looking at the cache plugin code i think we never intended the config to be null. i think having null in the configuration should still be allowed, but lead to the extension not setting the array key at all. then the plugin will take its default behaviour. (inside the plugin it makes sense that the default is a list of caching instructions, but when passing parameters, we should not have a default list, as that would not be future proof).

can you please instead of this change add a null-check to the cache plugin configuration in the extension? and if the respect_response_cache_directives is null, unset it from the options?

@ostrolucky
Copy link
Collaborator

As explained, better to update plugin instead. Closing

@dbu
Copy link
Collaborator

dbu commented Apr 29, 2022

i am fixing the configuration handling in #416

@dbu
Copy link
Collaborator

dbu commented Apr 29, 2022

https://github.com/php-http/HttplugBundle/releases/tag/1.26.1

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.

3 participants