Skip to main content

Rails Tip: Safe Usage of URI.parse

Blog post   •   Jan 26, 2010 13:41 GMT

As documented already by Doug URI.parse will thrown an exception if your URL has a trailing space. It also throws an exception on invalid URLs in general. To avoid having URI.parse bomb on your pages you can use a construct like this:


gist

Comments (1)

    Hi!

    Thanks for such a knowledgeable post.

    <a href="http://airul.id/tech/">Airultech</a>

    - Market Research Vietnam - May 18, 2016 06:19 GMT

Add comment

Comment