snoopdave opened a new pull request, #217: URL: https://github.com/apache/roller/pull/217
A weblog with a custom theme finds its resources in the media library. `ResourceServlet` and `PreviewResourceServlet` now serve those files with the same headers as other media: - Stylesheets and scripts keep their type, so a custom theme's pages can still load them. - Other types are served inline only when they are an image, audio, video, PDF or plain text. Anything else is a download, as on `/mediaresource/`. The new `MediaTypePolicy.applyThemeMediaHeaders` makes that choice, and `WeblogCustomTheme.isMediaFile` tells 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 as `text/css`. - `MediaFileBeanTest`: `copyTo` leaves 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). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
