This website works better with JavaScript.
Home
Explore
Help
Sign In
jyt94
/
closedSocialMastodon
forked from
closed-social/mastodon
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Override Rack::Request to use the same trusted proxy settings as Rails
closed-social-v3
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