From 717bf771f7757f34f9fd7f4d4642cd896b035e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20ALBER?= Date: Fri, 3 Jun 2016 22:55:39 +0200 Subject: [PATCH] Publish release 1.3.0 --- bower.json | 2 +- package.json | 2 +- release/libexec/git-core/git-webui | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 77eac4e..f884e08 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "git-webui", - "version": "1.2.0", + "version": "1.3.0", "authors": [ "Éric ALBER " ], diff --git a/package.json b/package.json index 143c6ae..d6cac32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "git-webui", - "version": "1.2.0", + "version": "1.3.0", "description": "A web user interface for git", "main": "index.js", "scripts": { diff --git a/release/libexec/git-core/git-webui b/release/libexec/git-core/git-webui index 1e6ce76..39a3d72 100755 --- a/release/libexec/git-core/git-webui +++ b/release/libexec/git-core/git-webui @@ -43,6 +43,22 @@ IS_WINDOWS = platform.system() == "Windows" allowed_hosts = ["127.0.0.1", "localhost"] +class HTTPServerIPng(HTTPServer): + def __init__( + self, server_address, RequestHandlerClass, + bind_and_activate=True): + if not isinstance(server_address,tuple) or len(server_address) < 2: + raise TypeError("server_address must be a tuple (address,port)") + + address_info = socket.getaddrinfo(server_address[0], + server_address[1], + 0, 0, socket.IPPROTO_TCP)[0] + + self.address_family = address_info[0] + HTTPServer.__init__(self,address_info[4], + RequestHandlerClass, + bind_and_activate) + class WebUiRequestHandler(SimpleHTTPRequestHandler): @@ -298,7 +314,7 @@ if __name__ == '__main__': httpd = None while httpd is None: try: - httpd = HTTPServer((host, port), WebUiRequestHandler) + httpd = HTTPServerIPng((host, port), WebUiRequestHandler) except socket.error as e: if args.port is not None: sys.stderr.write("Port {} is already in use, try another one\n".format(port))