Skip to content

test: add tests for static asset serving and path traversal - #6317

Merged
chenjiahan merged 3 commits into
mainfrom
serve_assets_test_1007
Oct 8, 2025
Merged

test: add tests for static asset serving and path traversal#6317
chenjiahan merged 3 commits into
mainfrom
serve_assets_test_1007

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

Add test cases to verify static file serving functionality and security against path traversal attacks.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 7, 2025 14:49
@netlify

netlify Bot commented Oct 7, 2025

Copy link
Copy Markdown

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit db13922
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68e528adc996a9000844b9ac
😎 Deploy Preview https://deploy-preview-6317--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 46 (🔴 down 15 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds comprehensive end-to-end tests for static asset serving functionality and security validation against path traversal attacks in the Rsbuild server.

  • Creates test cases to verify static file serving from both public directory and built assets
  • Implements security tests to ensure path traversal attacks return 403 Forbidden responses
  • Sets up test infrastructure with sample assets and JavaScript files

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
e2e/cases/server/serve-assets/src/index.js Adds sample JavaScript file for testing static asset serving
e2e/cases/server/serve-assets/public/foo.txt Creates test asset file in public directory
e2e/cases/server/serve-assets/index.test.ts Implements test cases for static serving and path traversal security

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan
chenjiahan merged commit d4222ef into main Oct 8, 2025
11 checks passed
@chenjiahan
chenjiahan deleted the serve_assets_test_1007 branch October 8, 2025 02:24
@chenjiahan chenjiahan mentioned this pull request Oct 8, 2025
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.

2 participants