Skip to content

Conversation

@DannyvdSluijs
Copy link
Collaborator

Replaces #840 (due to blocked write access on fork)

@DannyvdSluijs DannyvdSluijs merged commit b1562e4 into master Aug 29, 2025
17 checks passed
@DannyvdSluijs DannyvdSluijs deleted the php85 branch August 29, 2025 08:50
DannyvdSluijs added a commit that referenced this pull request Sep 9, 2025
This fixes a regression introduced in
#841

If a process/request runs:

- file_get_contents on an HTTP URL.
- then a json-schema validation using a file://... URL as schema (not
all schema are remotely loaded)
- and `http_get_last_response_headers()` is available

Then you end up with:

- file_get_contents on the URL fills up the headers of that request
- json-schema validation loads the schema file but using file:// there
are no headers, and it seems like file_get_contents does not clear
previous headers itself
- http_get_last_response_headers() then returns the headers of the
previous request
- and then `$this->fetchContentType()` will fail unless the response
headers were of the correct `application/schema+json` mime type (which
is very unlikely).

So this PR clears the headers before we fetch the schema, to make sure
we have a clean slate. I'll probably report this to PHP as well because
IMO it is a bit surprising.

---------

Co-authored-by: Danny van der Sluijs <[email protected]>
@gnutix
Copy link

gnutix commented Dec 3, 2025

Any chance this deprecation could be backported to 5.x ? I'm using behatch/contexts (which is sadly abandoned) and it requires ^5.0. :(

@DannyvdSluijs
Copy link
Collaborator Author

Any chance this deprecation could be backported to 5.x ? I'm using behatch/contexts (which is sadly abandoned) and it requires ^5.0. :(

Hi @gnutix

There is a 5.x.x branch for which you can create a port based on this PR. I can do the merging and releasing.

DannyvdSluijs added a commit that referenced this pull request Dec 12, 2025
## Description
This PR will run the workflows (excluding phpstan) on the 5.x.x branch

## Related Issue
#841
#857

## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Other (please describe):

## Checklist

<!-- Mark completed items with an "x" -->

- [X] I have read the [CONTRIBUTING](CONTRIBUTING.md) guidelines
- [X] My code follows the code style of this project
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] All new and existing tests pass
- [ ] I have updated the documentation accordingly
- [X] My changes generate no new warnings

## Additional Notes

This should allow the run of workflows for #857 and future PR's against
the 5.x.x branch
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.

4 participants