Repository navigation
Conversation
A weblog with a custom theme finds its resources in the media library. Those files now get the same response headers as other media: stylesheets and scripts keep their type so the theme's pages can load them, and other types are served inline only when they are an image, audio, video, PDF or plain text. Both ResourceServlet and PreviewResourceServlet apply this. The upload form no longer sets a media file's original path. The media file editor sets it only when mediafile.originalPathEdit.enabled is true, which is when its form shows the field. Saving the editor without that setting no longer clears the original path.
snoopdave
commented
Oct 17, 2026
| library as before. Other files there, such as HTML or SVG, are served like | ||
| any other media file: as a download unless they are an image, audio, video, | ||
| PDF or plain text. The media file editor sets a file's original path only | ||
| when `mediafile.originalPathEdit.enabled=true`, as its form already shows. |
Contributor
Author
There was a problem hiding this comment.
ah, the memories "mediafile.originalPathEdit.enabled".
Contributor
Author
|
🐞Claude Issue: PR-Review: General Issues These are outside the diff hunks:
|
Contributor
Author
|
🤖Claude: fixed both general issues (local changes, not yet pushed):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A weblog with a custom theme finds its resources in the media library.
ResourceServletandPreviewResourceServletnow serve those files with the same headers as other media:/mediaresource/.The new
MediaTypePolicy.applyThemeMediaHeadersmakes that choice, andWeblogCustomTheme.isMediaFiletells the servlets which resources came from the media library. Resources that ship with a theme on disk are unchanged.The upload form no longer sets a media file's original path. The media file editor sets it only when
mediafile.originalPathEdit.enabled=true, which is when its form shows the field. Saving the editor without that setting used to clear the original path; it no longer does.Tests:
ResourceServletTest: a custom-theme weblog serves an HTML media file as a download and a CSS media file astext/css.MediaFileBeanTest:copyToleaves the original path alone.MediaTypePolicyTest,WeblogCustomThemeTest: the new methods.CHANGES.md: behaviour-change note.Full build and tests pass on JDK 11 (412 tests, 0 failures).