Skip to content

Web: Serve static assets from docroot (#150)#166

Merged
PurHur merged 1 commit into
masterfrom
feat/serve-static-assets-150
May 18, 2026
Merged

Web: Serve static assets from docroot (#150)#166
PurHur merged 1 commit into
masterfrom
feat/serve-static-assets-150

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 18, 2026

Summary

  • Serve non-.php files from the docroot with guessed Content-Type (css, js, png, svg, ico)
  • Reject URL paths containing .. segments; resolve files with realpath under docroot
  • Add style.css to examples/001-SimpleWeb and link it from example.php
  • Extend ServeTest for static CSS and path-traversal cases

Closes #150

Test plan

  • ./script/php-local.sh vendor/bin/phpunit test/real/ServeTest.php
  • make serve then curl http://127.0.0.1:8080/style.css returns 200 with text/css

Made with Cursor

Serve CSS, JS, images, and other non-PHP files with guessed MIME types,
reject path traversal, add SimpleWeb example stylesheet, and extend
ServeTest with static and security coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit a6b2e96 into master May 18, 2026
@PurHur PurHur deleted the feat/serve-static-assets-150 branch May 18, 2026 16:07
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.

Web: Serve static assets from docroot (CSS, JS, images)

1 participant