This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Override Rack::Request to use the same trusted proxy settings as Rails
closed-social-glitch-2
Eugen Rochko
7 years ago
parent
67befe5463
commit
61aee0006e
1 changed files
with
7 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
config/initializers/trusted_proxies.rb
+ 7
- 0
config/initializers/trusted_proxies.rb
View File
@ -0,0 +1,7 @@
module
Rack
class
Request
def
trusted_proxy?
(
ip
)
Rails
.
application
.
config
.
action_dispatch
.
trusted_proxies
.
any?
{
|
proxy
|
proxy
===
ip
}
end
end
end
Write
Preview
Loading…
Cancel
Save