Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/net/dav.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down