mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Split on comma and space
This commit is contained in:
parent
5ce24bf7c2
commit
3c8763669b
2 changed files with 2 additions and 2 deletions
|
@ -309,7 +309,7 @@ module Puma
|
||||||
return @peerip if @peerip
|
return @peerip if @peerip
|
||||||
|
|
||||||
if @remote_addr_header
|
if @remote_addr_header
|
||||||
hdr = (@env[@remote_addr_header] || LOCALHOST_ADDR).split(" ").first
|
hdr = (@env[@remote_addr_header] || LOCALHOST_ADDR).split(/\s,/).first
|
||||||
@peerip = hdr
|
@peerip = hdr
|
||||||
return hdr
|
return hdr
|
||||||
end
|
end
|
||||||
|
|
|
@ -311,7 +311,7 @@ module Puma
|
||||||
# * header: http_header - set the remote address to the value of the
|
# * header: http_header - set the remote address to the value of the
|
||||||
# provided http header. For instance:
|
# provided http header. For instance:
|
||||||
# `set_remote_address header: "X-Real-IP"`.
|
# `set_remote_address header: "X-Real-IP"`.
|
||||||
# Only the first word (as separated by spaces)
|
# Only the first word (as separated by spaces or comma)
|
||||||
# is used, allowing headers such as X-Forwarded-For
|
# is used, allowing headers such as X-Forwarded-For
|
||||||
# to be used as well.
|
# to be used as well.
|
||||||
# * Any string - this allows you to hardcode remote address to any value
|
# * Any string - this allows you to hardcode remote address to any value
|
||||||
|
|
Loading…
Reference in a new issue