Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
4310431e
Commit
4310431e
authored
Feb 20, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use modified ActionDispatch::Static to let uploads go through to routes.
parent
eb210f4a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
config/initializers/static_files.rb
config/initializers/static_files.rb
+13
-0
lib/gitlab/middleware/static.rb
lib/gitlab/middleware/static.rb
+13
-0
No files found.
config/initializers/static_files.rb
0 → 100644
View file @
4310431e
begin
app
=
Rails
.
application
app
.
config
.
middleware
.
swap
(
ActionDispatch
::
Static
,
Gitlab
::
Middleware
::
Static
,
app
.
paths
[
"public"
].
first
,
app
.
config
.
static_cache_control
)
rescue
# If ActionDispatch::Static wasn't loaded onto the stack (like in production),
# an exception is raised.
end
\ No newline at end of file
lib/gitlab/middleware/static.rb
0 → 100644
View file @
4310431e
module
Gitlab
module
Middleware
class
Static
<
ActionDispatch
::
Static
UPLOADS_REGEX
=
/\A\/uploads(\/|\z)/
.
freeze
def
call
(
env
)
return
@app
.
call
(
env
)
if
env
[
'PATH_INFO'
]
=~
UPLOADS_REGEX
super
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment