~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-30 04:00:06 UTC
  • mfrom: (2466.3.1 normalize-remote-http-urls)
  • Revision ID: pqm@pqm.ubuntu.com-20070430040006-olr7xpzdbp02y1sd
(Andrew Bennetts) Normalise URLs in RemoteHTTPTransport before doing URL calculations to fix bad results.

Show diffs side-by-side

added added

removed removed

Lines of Context:
503
503
        """After connecting HTTP Transport only deals in relative URLs."""
504
504
        # Adjust the relpath based on which URL this smart transport is
505
505
        # connected to.
506
 
        base = self._http_transport.base
 
506
        base = urlutils.normalize_url(self._http_transport.base)
507
507
        url = urlutils.join(self.base[len('bzr+'):], relpath)
508
508
        url = urlutils.normalize_url(url)
509
509
        return urlutils.relative_url(base, url)
538
538
        # We either use the exact same http_transport (for child locations), or
539
539
        # a clone of the underlying http_transport (for parent locations).  This
540
540
        # means we share the connection.
541
 
        normalized_rel_url = urlutils.relative_url(self.base, abs_url)
 
541
        norm_base = urlutils.normalize_url(self.base)
 
542
        norm_abs_url = urlutils.normalize_url(abs_url)
 
543
        normalized_rel_url = urlutils.relative_url(norm_base, norm_abs_url)
542
544
        if normalized_rel_url == ".." or normalized_rel_url.startswith("../"):
543
545
            http_transport = self._http_transport.clone(normalized_rel_url)
544
546
        else: