diff options
Diffstat (limited to 'lib/yahns/proxy_pass.rb')
-rw-r--r-- | lib/yahns/proxy_pass.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 728ab3e..c8eec84 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -1,6 +1,7 @@ # -*- encoding: binary -*- # Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net> # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) +# frozen_string_literal: true require 'socket' require 'kgio' require 'kcar' # gem install kcar @@ -24,7 +25,7 @@ class Yahns::ProxyPass # :nodoc: # we must reinitialize the thread-local rbuf if it may get beyond the # current thread def detach_rbuf! - Thread.current[:yahns_rbuf] = '' + Thread.current[:yahns_rbuf] = ''.dup end def yahns_step # yahns event loop entry point @@ -225,7 +226,7 @@ class Yahns::ProxyPass # :nodoc: end req = "#{env['REQUEST_METHOD']} #{req} #{ver}\r\n" \ - "X-Forwarded-For: #{env["REMOTE_ADDR"]}\r\n" + "X-Forwarded-For: #{env["REMOTE_ADDR"]}\r\n".dup # pass most HTTP_* headers through as-is chunked = false |