Skip to content
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

Serve file as PHP if a static file wasn't found #1203

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

bgrgicak
Copy link
Collaborator

@bgrgicak bgrgicak commented Apr 5, 2024

Fixes #1186

What is this PR doing?

What problem is it solving?

How is the problem addressed?

Testing Instructions

@rhildred
Copy link

rhildred commented Apr 8, 2024

Thanks for this @bgrgicak . I am still eager to meet with you on slack. Unfortunately I am out of time to meet with you today. I got behind on marking and need to get caught up. Maybe Wednesday?

@bgrgicak
Copy link
Collaborator Author

bgrgicak commented Apr 8, 2024

@rhildred I can't on Wednesday. Would you mind sending me a DM on Slack and we can find a time there?

return await this.#dispatchToPHP(request, requestedUrl);
if (this.#isStaticFile(fsPath)) {
return this.#serveStaticFile(fsPath);
} else if (this.#isStaticWpCoreFile(fsPath)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have WordPress-specific code in PHP-wasm but I'm not sure how to resolve this.

I think that the best solution would be to catch this in service-worker and not even trigger the request handler.

The problem is that service-worker can't check if the file exists, so we would need to have a list of available core files.

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.

sitemap plugins don't work with playground
2 participants