tilboerner / laserchicken

RSS reader web application built on Rails
MIT License
20 stars 3 forks source link

feed urls without leading protocol #13

Open tilboerner opened 11 years ago

tilboerner commented 11 years ago

When an incomplete feed URL (without the protocol part) is entered, Laserchicken should add http:// as default. Otherwise, feed duplication won't be recognized and links to feed XML will break.

tilboerner commented 11 years ago

feed duplication won't be recognized

Same goes for alias URLs with trailing / or www subdomains. Just something to think about.

XORwell commented 11 years ago

what do you mean with links to feed XML will break

Entered a feed-url without http:// but got no errors.. Can you give some information how to reproduce it?

tilboerner commented 11 years ago

Sorry, should have been more precise. When you're admin, you have access to the /feeds resource, which lists all known feeds. In that list, there's a link to the actual XML with the (probably misleading) name "(web)". Without a a leading protocol, this link is treated as relative, which is incorrect.

I think the best way to deal with this is to make the URL complete by adding a default protocol as early as possible.

Incomplete URLs already in the database could be changed with the help of a migration, I guess.

XORwell commented 11 years ago

i decided to fix #10 a bit nicer than before and ended with a class which may also help to fix incomplete urls already in the database https://github.com/XORwell/laserchicken/commit/85a1f09f86afbd8a9bc938355b4f0dfeb6c1c92a