Skip to content

Proxy does not support HEAD request #116

@rledisez

Description

@rledisez

When issuing a HEAD request through the proxy of sc-server, sc-server dies.

How to reproduce:

  1. Set the following directive in a project Buildfile:
    proxy '/sproutcoredotcom', :to => 'sproutcore.com:80', :secure => false
  2. Send a HEAD request:
    curl -X HEAD http://localhost:4020/sproutcoredotcom

Result:

FATAL 19:07:24.007 ~ undefined method `call' for nil:NilClass 
FATAL 19:07:24.007 ~ BACKTRACE:
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/rack/proxy.rb:43:in `block in call'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/rack/proxy.rb:42:in `each'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/rack/proxy.rb:42:in `call'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/rack/proxy.rb:211:in `block (2 levels) in handle_proxy'
/Users/romain/.gem/ruby/1.9.1/gems/eventmachine-1.0.4/lib/em/deferrable.rb:151:in `call'
/Users/romain/.gem/ruby/1.9.1/gems/eventmachine-1.0.4/lib/em/deferrable.rb:151:in `set_deferred_status'
/Users/romain/.gem/ruby/1.9.1/gems/eventmachine-1.0.4/lib/em/deferrable.rb:191:in `succeed'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/client.rb:114:in `unbind'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/client.rb:71:in `on_request_complete'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/http_connection.rb:129:in `block in post_init'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/http_connection.rb:144:in `call'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/http_connection.rb:144:in `<<'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/http_connection.rb:144:in `receive_data'
/Users/romain/.gem/ruby/1.9.1/gems/em-http-request-1.1.1/lib/em-http/http_connection.rb:23:in `receive_data'
/Users/romain/.gem/ruby/1.9.1/gems/eventmachine-1.0.4/lib/eventmachine.rb:187:in `run_machine'
/Users/romain/.gem/ruby/1.9.1/gems/eventmachine-1.0.4/lib/eventmachine.rb:187:in `run'
/Users/romain/.gem/ruby/1.9.1/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
/Users/romain/.gem/ruby/1.9.1/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
/Users/romain/.gem/ruby/1.9.1/gems/rack-1.6.0/lib/rack/handler/thin.rb:19:in `run'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/rack/service.rb:93:in `start'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/tools/server.rb:71:in `server'
/Users/romain/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Users/romain/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Users/romain/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Users/romain/.gem/ruby/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/tools.rb:445:in `start'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/lib/sproutcore/tools.rb:30:in `invoke'
/Users/romain/.gem/ruby/1.9.1/gems/sproutcore-1.11.0/bin/sc-server:11:in `<top (required)>'
/Users/romain/.gem/ruby/1.9.1/bin/sc-server:23:in `load'
/Users/romain/.gem/ruby/1.9.1/bin/sc-server:23:in `<main>'

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