lib/micropub/endpoint/client.rb in micropub-endpoint-1.0.0 vs lib/micropub/endpoint/client.rb in micropub-endpoint-1.0.1
- old
+ new
@@ -3,9 +3,11 @@
class Client
def initialize(url)
raise ArgumentError, "url must be a String (given #{url.class.name})" unless url.is_a?(String)
@uri = Addressable::URI.parse(url)
+
+ raise ArgumentError, 'url must be an absolute URI (e.g. https://example.com)' unless @uri.absolute?
rescue Addressable::URI::InvalidURIError => error
raise InvalidURIError, error
end
def endpoint