summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/httpserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitautodeploy/httpserver.py')
-rw-r--r--gitautodeploy/httpserver.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/gitautodeploy/httpserver.py b/gitautodeploy/httpserver.py
index 8032556..d9310d1 100644
--- a/gitautodeploy/httpserver.py
+++ b/gitautodeploy/httpserver.py
@@ -131,7 +131,11 @@ class WebhookRequestHandler(BaseHTTPRequestHandler):
# Assume GitLab if the X-Gitlab-Event HTTP header is set
if 'x-gitlab-event' in request_headers:
- return parsers.GitLabRequestParser
+ # Special Case for Gitlab CI
+ if content_type == "application/json" and "build_status" in data:
+ return parsers.GitLabCIRequestParser
+ else:
+ return parsers.GitLabRequestParser
# Assume GitHub if the X-GitHub-Event HTTP header is set
elif 'x-github-event' in request_headers:
@@ -144,11 +148,6 @@ class WebhookRequestHandler(BaseHTTPRequestHandler):
return parsers.BitBucketRequestParser
- # Special Case for Gitlab CI
- elif content_type == "application/json" and "build_status" in data:
-
- return parsers.GitLabCIRequestParser
-
# This handles old GitLab requests and Gogs requests for example.
elif content_type == "application/json":
@@ -305,4 +304,4 @@ class WebhookRequestHandler(BaseHTTPRequestHandler):
file = open(target, 'w')
file.write(json.dumps(test_case, sort_keys=True, indent=4))
- file.close() \ No newline at end of file
+ file.close()