Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
68b591e0
Unverified
Commit
68b591e0
authored
2 years ago
by
Sébastien Gaya
Browse files
Options
Downloads
Patches
Plain Diff
404 when invalid signature media
parent
03fe1a86
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/media_controller.rb
+5
-1
5 additions, 1 deletion
app/controllers/media_controller.rb
with
5 additions
and
1 deletion
app/controllers/media_controller.rb
+
5
−
1
View file @
68b591e0
...
...
@@ -2,7 +2,11 @@ class MediaController < ApplicationController
skip_before_action
:authenticate_user!
def
show
@blob
=
ActiveStorage
::
Blob
.
find_signed!
params
[
:signed_id
]
begin
@blob
=
ActiveStorage
::
Blob
.
find_signed!
params
[
:signed_id
]
rescue
ActiveSupport
::
MessageVerifier
::
InvalidSignature
raise
ActiveRecord
::
RecordNotFound
end
@size
=
@blob
.
byte_size
if
@blob
.
variable?
variant_service
=
VariantService
.
compute
(
@blob
,
params
[
:filename_with_transformations
],
params
[
:format
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment