diff --git a/lib/net/dav.rb b/lib/net/dav.rb index ea29d63..2fe2731 100644 --- a/lib/net/dav.rb +++ b/lib/net/dav.rb @@ -190,6 +190,12 @@ def handle_request(req, headers, limit = MAX_REDIRECTS, &block) return handle_request(req, headers, limit - 1, &block) when Net::HTTPRedirection then location = URI.parse(response['location']) + + # Support relative redirects, where they are of the format of /blah/ + location.scheme ||= @uri.scheme + location.host ||= @uri.host + location.port ||= @uri.port + if (@uri.scheme != location.scheme || @uri.host != location.host || @uri.port != location.port)