Skip to content

fix: harden public image serving#2

Open
Zhenvip wants to merge 1 commit into
dephizee:masterfrom
Zhenvip:earn-dephizee-photo-1
Open

fix: harden public image serving#2
Zhenvip wants to merge 1 commit into
dephizee:masterfrom
Zhenvip:earn-dephizee-photo-1

Conversation

@Zhenvip
Copy link
Copy Markdown

@Zhenvip Zhenvip commented May 25, 2026

Closes #1

Summary

  • add a small public image path resolver that rejects malformed paths and directory traversal
  • use it before streaming files from public/images so requests cannot escape the image root
  • make npm test run the new Node test suite and document basic development commands
  • honor PORT when starting the server

Verification

  • npm test
  • node --check server.js && node --check lib/static-images.js && node --check lib/fileserver.js
  • git diff --check HEAD~1 HEAD

@Zhenvip Zhenvip mentioned this pull request May 25, 2026
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.

Rework my old app

2 participants