From 3cb20d8f8c42c3433a269abbaf437ad101a97563 Mon Sep 17 00:00:00 2001 From: "Gustavo L. de M. Chaves" Date: Tue, 10 Jan 2017 16:46:14 -0200 Subject: [PATCH] Do not prepend default host to absolute URLs Issue: https://rt.cpan.org/Ticket/Display.html?id=119790 --- lib/REST/Client.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/REST/Client.pm b/lib/REST/Client.pm index fa35fec..6e77723 100644 --- a/lib/REST/Client.pm +++ b/lib/REST/Client.pm @@ -102,8 +102,8 @@ The config flags are: =item host -A default host that will be prepended to all requests. Allows you to just -specify the path when making requests. +A default host that will be prepended to all requests using relative URLs. +Allows you to just specify the path when making requests. The default is undef - you must include the host in your requests. @@ -476,6 +476,9 @@ sub _prepareURL { my $self = shift; my $url = shift; + # Do not prepend default host to absolute URLs. + return $url if $url =~ /^https?:/; + my $host = $self->getHost; if($host){ $url = '/'.$url unless $url =~ /^\//;