Skip to content

Commit

Permalink
Add Access-Control-Allow-Origin to /json pages to enable cross site r…
Browse files Browse the repository at this point in the history
…equests with XHR.
  • Loading branch information
maruel authored and ayust committed Oct 14, 2010
1 parent 54c42cf commit f45a519
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions master/buildbot/status/web/status_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def render_GET(self, request):
data = self.content(request)
if isinstance(data, unicode):
data = data.encode("utf-8")
request.setHeader("Access-Control-Allow-Origin", "*")
if RequestArgToBool(request, 'as_text', False):
request.setHeader("content-type", 'text/plain')
else:
Expand Down

0 comments on commit f45a519

Please sign in to comment.