lib/httping/runner.rb in httping-1.1.0 vs lib/httping/runner.rb in httping-1.3.0
- old
+ new
@@ -69,15 +69,19 @@
end
def parse_uri
uri = URI.parse(ARGV.first)
+ if uri.class == URI::Generic
+ uri = URI.parse("http://#{ARGV.first}")
+ end
+
+ uri.path = "/" unless uri.path.match /^\//
+
unless ["http", "https"].include?(uri.scheme)
puts "ERROR: Invalid URI #{uri}"
exit
end
- uri.path = "/" unless uri.path.match /^\//
-
uri
end
end
\ No newline at end of file