sproutcore / abbot

SproutCore Build Tools [deprecated]
http://www.sproutcore.com
88 stars 44 forks source link

Bug with proxy when there is a ~ in the url #5

Closed jtaby closed 14 years ago

jtaby commented 14 years ago

If you setup a proxy like so:

proxy '/fu/', :to => 'localhost/~majd', :url => '/'

Then sc-server will throw an exception like so:

SocketError: getaddrinfo: nodename nor servname provided, or not known /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:644:in initialize' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:644:inopen' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:644:in block in connect' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/timeout.rb:44:intimeout' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/timeout.rb:87:in timeout' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:644:inconnect' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:637:in do_start' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:626:instart' /Users/majd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:490:in start' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/proxy.rb:73:inhandle_proxy' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/proxy.rb:25:in block in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/proxy.rb:23:ineach' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/proxy.rb:23:in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/cascade.rb:23:inblock in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/cascade.rb:22:in each' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/cascade.rb:22:incall' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/recursive.rb:43:in_call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/recursive.rb:38:in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/conditionalget.rb:25:incall' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/service.rb:110:in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/content_length.rb:13:incall' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/chunked.rb:15:in call' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/connection.rb:76:inblock in pre_process' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/connection.rb:74:in catch' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/connection.rb:74:inpre_process' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/connection.rb:57:in process' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/connection.rb:42:inreceive_data' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in start' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.7/lib/thin/server.rb:156:instart' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:in run' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/rack/service.rb:93:instart' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/tools/server.rb:43:in server' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.1/lib/thor/task.rb:22:inrun' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.1/lib/thor/invocation.rb:118:in invoke_task' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.1/lib/thor.rb:246:indispatch' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.1/lib/thor/base.rb:389:in start' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/tools.rb:337:instart' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/lib/sproutcore/tools.rb:30:in invoke' /Users/majd/.rvm/gems/ruby-1.9.2-p0/gems/sproutcore-1.4.1/bin/sc-server:16:in<top (required)>' /Users/majd/.rvm/gems/ruby-1.9.2-p0/bin/sc-server:19:in load' /Users/majd/.rvm/gems/ruby-1.9.2-p0/bin/sc-server:19:in

'

wagenet commented 14 years ago

You set it up wrong. You want

proxy '/fu', :to => 'localhost', :url => '/~majd'