##// END OF EJS Templates
hgweb: fixes to make hg serve prefix handling more robust
Michele Cella -
r5970:f25070ec default
parent child Browse files
Show More
@@ -2418,11 +2418,17 b' def serve(ui, repo, **opts):'
2418 2418
2419 2419 if not ui.verbose: return
2420 2420
2421 if self.httpd.prefix:
2422 prefix = self.httpd.prefix.strip('/') + '/'
2423 else:
2424 prefix = ''
2425
2421 2426 if self.httpd.port != 80:
2422 ui.status(_('listening at http://%s:%d/\n') %
2423 (self.httpd.addr, self.httpd.port))
2427 ui.status(_('listening at http://%s:%d/%s\n') %
2428 (self.httpd.addr, self.httpd.port, prefix))
2424 2429 else:
2425 ui.status(_('listening at http://%s/\n') % self.httpd.addr)
2430 ui.status(_('listening at http://%s/%s\n') %
2431 (self.httpd.addr, prefix))
2426 2432
2427 2433 def run(self):
2428 2434 self.httpd.serve_forever()
@@ -172,7 +172,7 b' class hgwebdir(object):'
172 172 if u.configbool("web", "hidden", untrusted=True):
173 173 continue
174 174
175 parts = [req.env['PATH_INFO'], name]
175 parts = [req.env['PATH_INFO'].strip('/'), name]
176 176 if req.env['SCRIPT_NAME']:
177 177 parts.insert(0, req.env['SCRIPT_NAME'])
178 178 url = ('/'.join(parts).replace("//", "/")) + '/'
@@ -206,7 +206,9 b' def create_server(ui, repo):'
206 206 myui = repo.ui
207 207 address = myui.config("web", "address", "")
208 208 port = int(myui.config("web", "port", 8000))
209 prefix = myui.config("web", "prefix", "").rstrip("/")
209 prefix = myui.config("web", "prefix", "")
210 if prefix:
211 prefix = "/" + prefix.strip("/")
210 212 use_ipv6 = myui.configbool("web", "ipv6")
211 213 webdir_conf = myui.config("web", "webdir_conf")
212 214 ssl_cert = myui.config("web", "certificate")
General Comments 0
You need to be logged in to leave comments. Login now