]> git.ipfire.org Git - thirdparty/git.git/commitdiff
instaweb: fix ip binding for the python http.server
authorAlecs King <alecsk@gmail.com>
Fri, 10 Jan 2025 10:13:46 +0000 (18:13 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jan 2025 23:27:52 +0000 (15:27 -0800)
`git instaweb -d python` should bind the server to 0.0.0.0, while
`git instaweb -d python -l` should bind the server to 127.0.0.1.

The code had them backwards by mistake since 2eb14bb2d4
(git-instaweb: add Python builtin http.server support, 2019-01-28).

Signed-off-by: Alecs King <alecsk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-instaweb.sh

index 5ad50160bb035885d8c180bee3ebb0a8e9622abc..7b44f7078951b57bb5ece02edec2331ecc2b1056 100755 (executable)
@@ -694,9 +694,9 @@ class GitWebRequestHandler(CGIHTTPRequestHandler):
                return result
 
 
-bind = "127.0.0.1"
+bind = "0.0.0.0"
 if "$local" == "true":
-       bind = "0.0.0.0"
+       bind = "127.0.0.1"
 
 # Set our http root directory
 # This is a work around for a missing directory argument in older Python versions