Fix CORS proxy for local development and PHP 8.5#3164
Draft
Conversation
4b8fcb7 to
f032ee9
Compare
adamziel
reviewed
Jan 22, 2026
adamziel
reviewed
Jan 22, 2026
adamziel
reviewed
Jan 22, 2026
adamziel
reviewed
Jan 22, 2026
adamziel
requested changes
Jan 22, 2026
Collaborator
adamziel
left a comment
There was a problem hiding this comment.
I'm not sure I understand what this PR does, I've left some notes inline.
Member
Author
|
Sorry, this wasn't ready yet. I was fighting with the local cors proxy to work with git. |
39533bf to
258d8c1
Compare
Member
Author
|
I realized the problem was PHP8.5 and the error reporting that polluted the output. |
- Don't pass through Transfer-Encoding header (curl decodes chunked responses) - Don't pass through Connection header (proxy manages its own connection) - Simplify send_response_chunk (no manual chunking needed) - Skip POST requests in offline cache (Cache API doesn't support them) - Suppress PHP deprecation warnings to avoid polluting response body - Fix undefined CONTENT_LENGTH array access
cfc8a14 to
043a023
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
When running
npm run devwith PHP 8.5, the Vite dev server logs errors like:This happens because
curl_close()is deprecated since PHP 8.5 and outputs a deprecation warning that corrupts the HTTP response body.Additionally, the service worker's offline cache was throwing errors for POST requests because the Cache API doesn't support them.
Implementation details
CORS proxy fix:
curl_close()call - it has no effect since PHP 8.0 anywayOffline cache fix:
Testing Instructions
npm run dev