aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-01-28 00:56:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-08 18:43:02 +0300
commit4fe188dee733c28b8b7d2d6b3e7d7904d1d30b65 (patch)
treec089ad2ddf72478b579697f6571cefd8761938cf /libbpkg/manifest.hxx
parentaef171cd9a6948deb379be3515b972a0e9dcce13 (diff)
Fix repository_url ctor to normalize path
Diffstat (limited to 'libbpkg/manifest.hxx')
-rw-r--r--libbpkg/manifest.hxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index e00e551..8c20e76 100644
--- a/libbpkg/manifest.hxx
+++ b/libbpkg/manifest.hxx
@@ -467,7 +467,9 @@ namespace bpkg
// Notes:
//
// - For an empty URL object all components are absent. For a non-empty one
- // the directory path is always present and normalized.
+ // the path is always present and normalized. The string representation of
+ // non-empty object with non-empty path never contains the trailing slash
+ // (except for the root path on POSIX system).
//
// - For the remote URL object the host name is in the lower case (IPv4/6 are
// not supported) and the path is relative.
@@ -508,6 +510,23 @@ namespace bpkg
// the URL matches the repository type. Throw std::invalid_argument if the
// URL object is a relative local path.
//
+ // @@ Note that the repository location string representation may differ
+ // from the original URL in the presence of the trailing slash. This
+ // may cause problems with some WEB servers that are sensitive to the
+ // trailing slash presence/absence. For example:
+ //
+ // $ git clone http://git.sv.gnu.org/r/config.git
+ // warning: redirecting to http://git.savannah.gnu.org/r/config.git/
+ //
+ // Also note that we disregard the slash presence/absence on multiple
+ // levels:
+ //
+ // - reduce absent path to an empty one in
+ // repository_url_traits::translate_scheme() (so a.com/ becomes a.com)
+ // - use path::*string() rather than path::*representation() functions
+ // in repository_url_traits::translate_*() functions
+ // - may append slash in repository_location ctor
+ //
explicit
repository_location (repository_url, repository_type);