Strange routing issue

41 views
Skip to first unread message

Mando Escamilla

unread,
Aug 16, 2011, 4:21:23 PM8/16/11
to golia...@googlegroups.com
All,

I'm playing around with the async_upload example and I've hit a strange snag - running it standalone works fine, but in conjunction with a router it doesn't work.

Assuming this directory structure:

test_async
├── Gemfile
├── Gemfile.lock
├── apis
    └── async_upload.rb
└── test.rb

If I cd into apis and run `ruby async_upload.rb`, and the following request, all is well.

  $ curl -X PUT -H 'Content-Type: image/jpeg' http://localhost:8910 --data-binary "this is some awesome data"
  [:body, "this is some awesome data"][:head, {"User-Agent"=>"curl/7.21.6 (x86_64-apple-darwin10.8.0) libcurl/7.21.6 OpenSSL/0.9.8r zlib/1.2.3", "Host"=>"localhost:8910", "Accept"=>"*/*", "Content-Type"=>"image/jpeg", "Content-  Length"=>"38"}]%          

If I cd into the root dir and ruby `ruby test.rb`, none of the callbacks (on_body, on_headers or on_close) get called.

  $ /usr/local/Cellar/curl/7.21.6/bin/curl -X PUT -H 'Content-Type: image/jpeg' http://localhost:8910/async --data-binary "this is some awesome data for that ass"
[:body, nil][:head, nil]%    
     
test.rb looks like this:

require 'goliath'

api_dir = File.dirname(__FILE__) + '/apis'
$LOAD_PATH.unshift(api_dir)
require 'async_upload'

class Test < Goliath::API
  put '/async' do
    run AsyncUpload.new
  end
end

Anyone have any ideas?  Project is at https://github.com/mando/Test-Async.

Thanks!

--
Mando

Ilya Grigorik

unread,
Aug 17, 2011, 1:04:22 AM8/17/11
to golia...@googlegroups.com
Doh.. Opened a bug for this: https://groups.google.com/forum/#!topic/goliath-io/-DUVYq0d09E

Thanks for reporting this.

ig
Reply all
Reply to author
Forward
0 new messages