/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/http_server.py

  • Committer: Jelmer Vernooij
  • Date: 2020-07-28 00:32:38 UTC
  • mfrom: (7490.40.77 work)
  • mto: (7490.40.79 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200728003238-vx5u412hn72f18lr
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
        header_line = '%s: %s\r\n' % (keyword, value)
195
195
        return len(header_line)
196
196
 
197
 
    def send_head(self):
198
 
        """Overrides base implementation to work around a bug in python2.5."""
199
 
        path = self.translate_path(self.path)
200
 
        if os.path.isdir(path) and not self.path.endswith('/'):
201
 
            # redirect browser - doing basically what apache does when
202
 
            # DirectorySlash option is On which is quite common (braindead, but
203
 
            # common)
204
 
            self.send_response(301)
205
 
            self.send_header("Location", self.path + "/")
206
 
            # Indicates that the body is empty for HTTP/1.1 clients
207
 
            self.send_header('Content-Length', '0')
208
 
            self.end_headers()
209
 
            return None
210
 
 
211
 
        return http_server.SimpleHTTPRequestHandler.send_head(self)
212
 
 
213
197
    def send_range_content(self, file, start, length):
214
198
        file.seek(start)
215
199
        self.wfile.write(file.read(length))