From a3c93a3d456bc91183e8fdd5574778deaa6ec5d8 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Oct 10 2018 09:26:10 +0000 Subject: Also provide PATH and content encoding for clone.py Signed-off-by: Patrick Uiterwijk --- diff --git a/pagure/ui/clone.py b/pagure/ui/clone.py index 3a42a84..1437ea8 100644 --- a/pagure/ui/clone.py +++ b/pagure/ui/clone.py @@ -41,6 +41,7 @@ def proxy_raw_git(): """ # We are going to shell out to gitolite-shell. Prepare the env it needs. gitenv = { + "PATH": os.environ["PATH"], # These are the vars git-http-backend needs "PATH_INFO": flask.request.path, "REMOTE_USER": flask.request.remote_user, @@ -54,6 +55,10 @@ def proxy_raw_git(): # This might be needed by hooks "PAGURE_CONFIG": os.environ.get("PAGURE_CONFIG"), "PYTHONPATH": os.environ.get("PYTHONPATH"), + # Some HTTP headers that we want to pass through because they + # impact the request/response. Only add headers here that are + # "safe", as in they don't allow for other issues. + "HTTP_CONTENT_ENCODING": flask.request.content_encoding, } gitolite = pagure_config["HTTP_REPO_ACCESS_GITOLITE"] @@ -77,6 +82,8 @@ def proxy_raw_git(): "CONTENT_TYPE", "QUERY_STRING", "PYTHONPATH", + "PATH", + "HTTP_CONTENT_ENCODING", ): if not gitenv[key]: del gitenv[key]