Base URL
PDF file delivery
The filename of the PDF to retrieve. Supports URL-encoded paths.
Response
Returns the PDF file with appropriate headers for inline viewing in browsers.Set to
application/pdfSet to
inline to display PDFs in the browserError responses
Security features
Path traversal prevention
The endpoint protects against Local File Inclusion (LFI) attacks by:- URL-decoding the filename parameter
- Resolving the absolute path of the requested file
- Verifying the resolved path starts with the PDF directory
- Blocking requests that attempt to access files outside the PDF folder
../../etc/passwd are automatically blocked and logged.
CORS configuration
The server restricts cross-origin requests to prevent malicious websites from accessing your local server: Allowed origins:http://localhost:3000http://localhost:5173http://127.0.0.1:3000http://127.0.0.1:5173
- GET
- POST
- OPTIONS
PDF storage location
PDFs are stored in thePDF directory within the current working directory. The directory is created automatically if it doesn’t exist.