Skip to content

Support index.php fallback for files in built-in server #12992

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

iluuu1994
Copy link
Member

If no router script is used, the built-in webserver will now look for a fallback index file recursively in all cases, including URLs with a period.

Furthermore, if a router script returns false, we will no longer perform a recursive fallback. Previously, recursive fallback was performed when the URL contained no period. The rationale for this is that it avoids serving the root index.php file when the router has indicated that the file is a static file.

The existing behavior essentially assumes that virtual routes don't contain periods, and that real files do. Both of those assumptions are incorrect.

Fixes GH-12604

@asmecher
Copy link

@iluuu1994, at a glance, I think this removes support for PATH_INFO URLs. Is that intended?

@iluuu1994
Copy link
Member Author

@asmecher I'm not sure what you are referencing. Can you clarify?

@asmecher
Copy link

@iluuu1994 My apologies -- I've just checked and PATH_INFO URLs are still supported after the change you propose.

iluuu1994 added a commit to iluuu1994/php-src that referenced this pull request Jan 8, 2024
If no router script is used, the built-in webserver will now look for a fallback
index file recursively in all cases, including URLs with a period.

Fixes phpGH-12604
Closes phpGH-12992
iluuu1994 added a commit to iluuu1994/php-src that referenced this pull request Jan 8, 2024
If no router script is used, the built-in webserver will now look for a fallback
index file recursively in all cases, including URLs with a period.

Fixes phpGH-12604
Closes phpGH-12992
If no router script is used, the built-in webserver will now look for a fallback
index file recursively in all cases, including URLs with a period.

Fixes phpGH-12604
Closes phpGH-12992
@asmecher
Copy link

asmecher commented Jan 9, 2024

Much appreciated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Built-in server assumes static content if there's a "." in the URL
4 participants