Skip to content

Look a media file up in the addressed weblog before loading its content - #341

Merged
mraible merged 1 commit into
masterfrom
scoped-media-file-lookup
Nov 20, 2026
Merged

mraible merged 1 commit into
masterfrom
scoped-media-file-lookup

Conversation

@mraible

@mraible mraible commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Follows up #308 from review.

MediaResourceServlet loaded the file and its content with getMediaFile(id, true) and only then checked its weblog. It now looks the file up with getMediaFile(weblog, id), which finds only files in the weblog named in the address, and loads the content only after that.

Tests: MediaResourceServletTest now also checks that a file requested at another weblog's address is never loaded.

MediaResourceServlet loaded the file and its content with getMediaFile(id, true) and only then checked its weblog. It now looks the file up with getMediaFile(weblog, id), which finds only files in the weblog named in the address, and loads the content only after that.
@mraible
mraible requested a review from snoopdave November 18, 2026 04:16

@snoopdave snoopdave 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.

Review of 8af4a0aff: The servlet checks the addressed weblog before loading media content. The new test would fail under the old behavior, and the twin PR has the same fix hunks. I found no verified issue.

No new issues found.

@mraible
mraible merged commit 365d850 into master Nov 20, 2026
9 checks passed
@mraible
mraible deleted the scoped-media-file-lookup branch November 20, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants