Web: populate $_SERVER HTTP_* from incoming headers (closes #193)#229
Merged
Conversation
Map incoming HTTP headers to CGI-style $_SERVER keys in the dev server, VM superglobal population, and AOT runtime refresh so small web apps can read HTTP_HOST and custom X-* headers under static compilation. Co-authored-by: Cursor <cursoragent@cursor.com>
6373172 to
734254b
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.
Summary
$_SERVERkeys (HTTP_HOST,HTTP_X_*,CONTENT_TYPE,CONTENT_LENGTH) inbin/serve.php/bin/serve-aot.phpviaDevServerHTTP_*/CONTENT_*from$_ENVin VM superglobal population (PHPT/CGI env)__superglobals__refresh()from the process environmentTest plan
php vendor/bin/phpunit test/unit/Web/SuperglobalsHttpHeadersTest.php(Docker php:8.2-cli)HTTP_HOST=example.test HTTP_X_CUSTOM=1 … php bin/vm.php -r '…'php vendor/bin/phpunit test/aot/RuntimeSuperglobalRefreshTest.php --filter testHttpHostFromCgiEnvironment(with LLVM 9)script/docker-ci.shon maintainer hostCloses #193
Made with Cursor