module Puma::Request

def req_env_post_parse(env)

Other tags:
    Version: - 5.0.3

Parameters:
  • env (Hash) -- see Puma::Client#env, from request, modifies in place
def req_env_post_parse(env)
  to_delete = nil
  to_add = nil
  env.each do |k,v|
    if k.start_with?("HTTP_") && k.include?(",") && k != "HTTP_TRANSFER,ENCODING"
      if to_delete
        to_delete << k
      else
        to_delete = [k]
      end
      unless to_add
        to_add = {}
      end
      to_add[k.tr(",", "_")] = v
    end
  end
  if to_delete
    to_delete.each { |k| env.delete(k) }
    env.merge! to_add
  end
end