Repository navigation
[FAQ Bot] NEW: Why does a Playwright security test return HTTP 403 instead of the expec - #488
github-actions[bot] wants to merge 1 commit into
Conversation
|
This happens because Vite and Nginx handle incoming HTTP requests differently, especially requests for sensitive files, hidden directories, or paths that should not be publicly accessible. A Playwright test expecting HTTP 404 Not Found may receive 403 Forbidden when run against the Vite development server instead of the production Nginx server. 403 Forbidden: The server understood the request but refuses to serve the resource. Both responses can prevent access to a sensitive resource, but they are not interchangeable when your test explicitly requires a particular status code. Why Vite and Nginx behave differently?
|
✨ FAQ NEW
Course: ai-dev-tools-zoomcamp
Section: 02-development (The issue is about frontend/backend environment differences and how requests are handled during testing, which fits Unit 2’s full-stack development/testing and local dev-to-production contract behavior.)
Related Issue: #487
Question
Why does a Playwright security test return HTTP 403 instead of the expected HTTP 404 when using Vite rather than production Nginx?
Decision Rationale
This specific Playwright security-test mismatch (expected 404 vs actual 403) caused by differing development (Vite) vs production (Nginx) routing/blocking is not covered by any existing FAQ excerpt.
Placement Details
02-developmentplaywright-403-vite-vs-404-nginx-security-test🤖 Generated by FAQ Bot
Closes #487