From db82cb117c95152213ef5b5161f737c7e2c9b9c8 Mon Sep 17 00:00:00 2001 From: Josh Cohen Date: Fri, 11 Mar 2016 22:33:08 -0500 Subject: [PATCH] curies: don't expand when the rel is already absolute (starts with http[s]:) --- lib/hyperclient/curie.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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