diff --git a/lib/hyperclient/curie.rb b/lib/hyperclient/curie.rb index 9afa295..6238bc7 100644 --- a/lib/hyperclient/curie.rb +++ b/lib/hyperclient/curie.rb @@ -40,8 +40,9 @@ def inspect # # rel - The String rel to expand. # - # Returns a new expanded url. + # Returns a new expanded url unless the url already starts with http[s]: def expand(rel) + return rel if /^http[s]?:/i.match(rel) return rel unless rel && templated? href.gsub('{rel}', rel) if href end