summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2018-04-14 20:25:14 +0200
committerJan Dittberner <jandd@cacert.org>2018-04-14 20:25:14 +0200
commit24735ced9a25259ec75492f197486bf52add24cf (patch)
tree6fdd4e0e4c1f85b2bc7bd05dacf99ac5718a599e
parent72445dce9b75e54c3f656dd47a091b2a4f8806d3 (diff)
downloadcacert-puppet-24735ced9a25259ec75492f197486bf52add24cf.tar.gz
cacert-puppet-24735ced9a25259ec75492f197486bf52add24cf.tar.xz
cacert-puppet-24735ced9a25259ec75492f197486bf52add24cf.zip
Fix HTTP handling of git-pull-hook
-rwxr-xr-xsitemodules/profiles/files/puppet_server/git-pull-hook9
1 files changed, 5 insertions, 4 deletions
diff --git a/sitemodules/profiles/files/puppet_server/git-pull-hook b/sitemodules/profiles/files/puppet_server/git-pull-hook
index d8761f5..78f75c3 100755
--- a/sitemodules/profiles/files/puppet_server/git-pull-hook
+++ b/sitemodules/profiles/files/puppet_server/git-pull-hook
@@ -57,7 +57,7 @@ class GitHookRequestHandler(BaseHTTPRequestHandler):
GIT_DIRECTORY, e)
self.send_response(HTTPStatus.OK)
self.send_header('Content-Type', 'text/plain; charset=utf8')
- self.flush_headers()
+ self.end_headers()
self.wfile.write(("updated %s" % GIT_DIRECTORY).encode('UTF-8'))
# noinspection PyPep8Naming
@@ -72,14 +72,15 @@ class GitHookRequestHandler(BaseHTTPRequestHandler):
self._handle_pull()
else:
self.send_response(HTTPStatus.UNAUTHORIZED)
- self.flush_headers()
+ self.end_headers()
elif self.path == '/health':
self.send_response(HTTPStatus.OK)
- self.flush_headers()
+ self.send_header('Content-Type', 'text/plain; charset=utf8')
+ self.end_headers()
self.wfile.write(b"I'm healthy!")
else:
self.send_error(HTTPStatus.BAD_REQUEST)
- self.flush_headers()
+ self.end_headers()
self.wfile.write(b"You requested something I do not understand")