hotsh / rstat.us

Simple microblogging network based on the ostatus protocol.
http://rstat.us/
Other
722 stars 215 forks source link

Error 500 when trying to add an URI on /follow #661

Open gregkare opened 12 years ago

gregkare commented 12 years ago

It seems to be related to #314

I've just opened an issue on ostatus which seems to cause this. I now know ostatus identifiers look like email adresses and not URI, but it's what I first tried and thus got the error page. Only then did I actually read the examples just some pixels below the form.

I've set up rstat.us on my machine so I can give you a stacktrace:

NoMethodError in SubscriptionsController#create

undefined method `new' for URI:Module
Rails.root: /Users/user/code//rstat.us

Application Trace | Framework Trace | Full Trace
app/models/feed.rb:58:in `populate'
app/models/feed.rb:43:in `create_from_feed_data'
lib/finds_or_creates_feeds.rb:9:in `find_or_create'
app/models/feed.rb:38:in `find_or_create'
app/controllers/subscriptions_controller.rb:65:in `create'
Request

Parameters:

{"utf8"=>"✓",
 "authenticity_token"=>"VZdI1YR9CtfQOWRQ8FZCUkU/xEwfDR/RQe0AplHClQ4=",
 "subscribe_to"=>"http://example.net/lala"}

To reproduce the issue (happens in production as well) :

There should probably be some JS validation on the form to avoid that regardless of the ostatus issue.

carols10cents commented 12 years ago

Yep, sounds like a bug. We should be liberal in what we accept, and at the very least not crash. Thank you for reporting the issue and taking the time to get the stack trace!!! :heart: :heart: :heart:

Nakort commented 12 years ago

I am thinking this OStatus::Feed.from_url(url) should raise an exception giving an invalid URI .

carols10cents commented 12 years ago

That sounds right, @Nakort.