diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2011-10-04 16:04:34 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2011-10-17 13:17:41 +0200 |
commit | 40bf05f6f1f8a56e1367eae70231b701c2e970dc (patch) | |
tree | ad99e334a504cb93def8c4538105fd8a2709a241 /src/backends/webdav/WebDAVSource.cpp | |
parent | 162aa961252a8a601cf862e0bd1f5cb0501de3b4 (diff) |
WebDAV: allow relative redirects (eGroupware)
eGroupware gives just a path as Location for a redirect. Accept that
by copying the missing pieces of information (scheme, host, port) from
the current session.
Diffstat (limited to 'src/backends/webdav/WebDAVSource.cpp')
-rw-r--r-- | src/backends/webdav/WebDAVSource.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backends/webdav/WebDAVSource.cpp b/src/backends/webdav/WebDAVSource.cpp index a6605acb..c9f76575 100644 --- a/src/backends/webdav/WebDAVSource.cpp +++ b/src/backends/webdav/WebDAVSource.cpp @@ -654,6 +654,16 @@ bool WebDAVSource::findCollections(const boost::function<bool (const std::string // follow to new location Neon::URI next = Neon::URI::parse(ex.getLocation()); Neon::URI old = m_session->getURI(); + // keep old host + scheme + port if not set in next location + if (next.m_scheme.empty()) { + next.m_scheme = old.m_scheme; + } + if (next.m_host.empty()) { + next.m_host = old.m_host; + } + if (!next.m_port) { + next.m_port = old.m_port; + } if (next.m_scheme != old.m_scheme || next.m_host != old.m_host || next.m_port != old.m_port) { |