Skip to content

serve icons through rails render#5029

Merged
johrstrom merged 1 commit intomasterfrom
rails-render-icons
Jan 28, 2026
Merged

serve icons through rails render#5029
johrstrom merged 1 commit intomasterfrom
rails-render-icons

Conversation

@johrstrom
Copy link
Contributor

related to #5028 and the PR that it's reverting.

Instead of having nginx serve these files through send_file that generates extra log messages, instead we'll use rails' utility to render any file without a layout.

This means it's done purely in ruby which has a performance hit, but I believe enabling the x-accel-mapping header may have security issues. I'm not 100% sure how a specially crafted request may get send_file coupled with a x-accel-mapping header to access files outside of the ALLOWLIST, but I figure this can turn a 1 in a million chance to 0, so that's the trade I'm willing to make.

Copy link
Contributor

@Bubballoo3 Bubballoo3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Tested with the changes from #5028 and confirmed that this still fixes #5003

@johrstrom johrstrom merged commit 8e4c4cd into master Jan 28, 2026
47 of 48 checks passed
@johrstrom johrstrom deleted the rails-render-icons branch January 28, 2026 18:48
@github-project-automation github-project-automation bot moved this from Awaiting Review to Merged/Closed in PR Review Pipeline Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants