~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-12-20 19:38:45 UTC
  • mfrom: (3133.1.3 177643)
  • mto: This revision was merged to the branch mainline in revision 3137.
  • Revision ID: v.ladeuil+lp@free.fr-20071220193845-bwttzbjqjppw8602
Fix bug #177643 by handling credentials embedded in urls works again for pycurl

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        else:
115
115
            self._range_hint = 'multi'
116
116
 
117
 
    def _remote_path(self, relpath):
118
 
        """Produce absolute path, adjusting protocol."""
119
 
        relative = urlutils.unescape(relpath).encode('utf-8')
120
 
        path = self._combine_paths(self._path, relative)
121
 
        return self._unsplit_url(self._unqualified_scheme,
122
 
                                 self._user, self._password,
123
 
                                 self._host, self._port,
124
 
                                 path)
125
 
 
126
117
    def has(self, relpath):
127
118
        raise NotImplementedError("has() is abstract on %r" % self)
128
119
 
151
142
        """
152
143
        raise NotImplementedError(self._get)
153
144
 
 
145
    def _remote_path(self, relpath):
 
146
        """See ConnectedTransport._remote_path.
 
147
 
 
148
        user and passwords are not embedded in the path provided to the server.
 
149
        """
 
150
        relative = urlutils.unescape(relpath).encode('utf-8')
 
151
        path = self._combine_paths(self._path, relative)
 
152
        return self._unsplit_url(self._unqualified_scheme,
 
153
                                 None, None, self._host, self._port, path)
 
154
 
 
155
    def _create_auth(self):
 
156
        """Returns a dict returning the credentials provided at build time."""
 
157
        auth = dict(host=self._host, port=self._port,
 
158
                    user=self._user, password=self._password,
 
159
                    protocol=self._unqualified_scheme,
 
160
                    path=self._path)
 
161
        return auth
 
162
 
154
163
    def get_request(self):
155
164
        return SmartClientHTTPMediumRequest(self)
156
165