Permalink
Browse files

Fixed uri parse error where scheme was nil

  • Loading branch information...
1 parent 5b91bd8 commit 3747954ad71ea16325d3cd83bca9cc68528456ea Oscar Sanchez committed Sep 7, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/app.rb
View
@@ -192,6 +192,12 @@ def invalid_url?(url)
valid_schemes = ['http', 'https']
begin
uri = URI.parse(url)
+ unless uri.path.nil?
+ if uri.host.nil? and uri.scheme.nil?
+ uri.host = uri.path
+ uri.scheme = 'http'
+ end
+ end
raise URI::InvalidURIError if uri.host == 'hurl.it'
raise URI::InvalidURIError if !valid_schemes.include? uri.scheme
false

0 comments on commit 3747954

Please sign in to comment.