Skip to content
This repository was archived by the owner on Dec 7, 2018. It is now read-only.
This repository was archived by the owner on Dec 7, 2018. It is now read-only.

missing keys in env #8

@schmurfy

Description

@schmurfy

It looks like some keys are missing, I found at least these:

SERVER_NAME
SERVER_PORT

I noticed because I use URLMap and it does some checks before routing any request which failed in my case xD
Here is the code:

    def call(env)
      path = env["PATH_INFO"]
      script_name = env['SCRIPT_NAME']
      hHost = env['HTTP_HOST']
      sName = env['SERVER_NAME']
      sPort = env['SERVER_PORT']

      @mapping.each do |host, location, match, app|
        unless hHost == host \
            || sName == host \
            || (!host && (hHost == sName || hHost == sName+':'+sPort))
          next
        end
     # ...

I am not sure what is the level of compatibility your are aiming for with reel-rack though.

For now I am doing my testing with:

class FixReel
  def initialize(next_app)
    @next_app = next_app
  end

  def call(env)
    env['SERVER_NAME'], env['SERVER_PORT'] = env['HTTP_HOST'].split(':')
    @next_app.call(env)
  end
end

use FixReel
# run xxx

that's definitely not production code for now it is enough for my tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions