summaryrefslogtreecommitdiff
path: root/zuul/web/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'zuul/web/__init__.py')
-rwxr-xr-xzuul/web/__init__.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py
index d6df14c58..6336ac15f 100755
--- a/zuul/web/__init__.py
+++ b/zuul/web/__init__.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright (c) 2017 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -438,6 +437,8 @@ class ZuulWebAPI(object):
'reason': request['reason'],
'node_hold_expiration': request['node_expiration']
})
+ resp = cherrypy.response
+ resp.headers['Access-Control-Allow-Origin'] = '*'
return result
@cherrypy.expose
@@ -460,6 +461,8 @@ class ZuulWebAPI(object):
if not request:
raise cherrypy.HTTPError(
404, 'Hold request %s does not exist.' % request_id)
+ resp = cherrypy.response
+ resp.headers['Access-Control-Allow-Origin'] = '*'
return {
'id': request['id'],
'tenant': request['tenant'],
@@ -1271,16 +1274,3 @@ class ZuulWeb(object):
return
self.repl.stop()
self.repl = None
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG)
- import zuul.lib.connections
- import zuul.lib.auth.authenticators
- connections = zuul.lib.connections.ConnectionRegistry()
- auths = zuul.lib.auth.authenticators.AuthenticatorRegistry()
- z = ZuulWeb(listen_address="127.0.0.1", listen_port=9000,
- gear_server="127.0.0.1", gear_port=4730,
- connections=connections, authenticators=auths)
- z.start()
- cherrypy.engine.block()