Skip to content

fix: add Last-Modified header to GET and HEAD responses - #1875

Open
AlyNotMe wants to merge 1 commit into
nodeSolidServer:mainfrom
AlyNotMe:fix/issue-1793-last-modified-header
Open

AlyNotMe wants to merge 1 commit into
nodeSolidServer:mainfrom
AlyNotMe:fix/issue-1793-last-modified-header

Conversation

@AlyNotMe

Copy link
Copy Markdown

Summary

  • Adds a Last-Modified header to GET and HEAD responses, using the resource's mtime from fs.stat
  • The header is only set when access has been granted (the request already passed the Read permission check before reaching this handler), in line with the protocol's requirement to avoid exposing information beyond what's necessary
  • mtime is now propagated through LDP.get() for all three return paths (HEAD-only, container, and file streaming)

Fixes #1793

Test plan

  • Added integration tests in test/integration/header-test.mjs covering both GET and HEAD requests
  • npm run lint passes
  • Full test suite passes (867 passing, 0 failing)

Note: I noticed #1856 already addresses this and has been approved — opening this anyway in case it's useful, happy to close if redundant.

Only sent when access is granted (200 path), using the resource's
mtime from fs.stat, as required by the Solid protocol.

Fixes nodeSolidServer#1793
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.

Server should include the Last-Modified header

1 participant