##// 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 if not ui.verbose: return
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 if self.httpd.port != 80:
2426 if self.httpd.port != 80:
2422 ui.status(_('listening at http://%s:%d/\n') %
2427 ui.status(_('listening at http://%s:%d/%s\n') %
2423 (self.httpd.addr, self.httpd.port))
2428 (self.httpd.addr, self.httpd.port, prefix))
2424 else:
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 def run(self):
2433 def run(self):
2428 self.httpd.serve_forever()
2434 self.httpd.serve_forever()
@@ -172,7 +172,7 b' class hgwebdir(object):'
172 if u.configbool("web", "hidden", untrusted=True):
172 if u.configbool("web", "hidden", untrusted=True):
173 continue
173 continue
174
174
175 parts = [req.env['PATH_INFO'], name]
175 parts = [req.env['PATH_INFO'].strip('/'), name]
176 if req.env['SCRIPT_NAME']:
176 if req.env['SCRIPT_NAME']:
177 parts.insert(0, req.env['SCRIPT_NAME'])
177 parts.insert(0, req.env['SCRIPT_NAME'])
178 url = ('/'.join(parts).replace("//", "/")) + '/'
178 url = ('/'.join(parts).replace("//", "/")) + '/'
@@ -206,7 +206,9 b' def create_server(ui, repo):'
206 myui = repo.ui
206 myui = repo.ui
207 address = myui.config("web", "address", "")
207 address = myui.config("web", "address", "")
208 port = int(myui.config("web", "port", 8000))
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 use_ipv6 = myui.configbool("web", "ipv6")
212 use_ipv6 = myui.configbool("web", "ipv6")
211 webdir_conf = myui.config("web", "webdir_conf")
213 webdir_conf = myui.config("web", "webdir_conf")
212 ssl_cert = myui.config("web", "certificate")
214 ssl_cert = myui.config("web", "certificate")
General Comments 0
You need to be logged in to leave comments. Login now