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]>
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