Server crash on bad uri
brenda opened this issue · comments
When get this uri:
/index?created_at=20130730T173924}
the server chash!
/Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/uri/common.rb:176:in split': bad URI(is not URI?): /index?created_at=20130730T173924} (URI::InvalidURIError) from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/uri/common.rb:211:in
parse'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/uri/common.rb:747:in parse' from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/uri/common.rb:994:in
URI'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/request.rb:90:in parse_header' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/connection.rb:34:in
block in post_init'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/connection.rb:63:in call' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/connection.rb:63:in
<<'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/connection.rb:63:in receive_data' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in
run_machine'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38:in
synchrony'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/server.rb:73:in start' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/runner.rb:304:in
run_server'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/runner.rb:224:in run' from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/application.rb:111:in
run!'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@my_app/gems/goliath-1.0.3/lib/goliath/application.rb:133:in `block in module:Goliath'
What's the full request to the server?
Thanks. Well, the "}" is an invalid character, so the error is correct - it should be escaped.
We definitely shouldn't crash the server (needs to be fixed), but the most we can do here is return a 500.. so you will still need to fix whatever is generating this request.
Yes, I am aware that te request is badly escape, but it shouldn't crash the server. I tried catching the exception but couldn't find exactly where, is there any way i could capture the exception to not make the server crash? or should i wait till you get it fixed?
Thanks
This still happens to me in Goliath 1.0.3. Is there a patch for this or how could I catch it to avoid a server crash?
Looked at the changes, LGTM
Awesome, thanks! 1.0.4 should be live.