From d39331f73b941e39f4b9470b72dc75beefded1c6 Mon Sep 17 00:00:00 2001 From: syptn Date: Thu, 19 Jul 2018 00:03:38 +0900 Subject: [PATCH] allow cross-origin for Random --- src/main/webapp/WEB-INF/groovy/random.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/webapp/WEB-INF/groovy/random.groovy b/src/main/webapp/WEB-INF/groovy/random.groovy index c302c4d..4283630 100644 --- a/src/main/webapp/WEB-INF/groovy/random.groovy +++ b/src/main/webapp/WEB-INF/groovy/random.groovy @@ -47,6 +47,10 @@ if (image) { log.log(Level.WARNING, "Exception updating impressions on image", e) } + response.setHeader("Access-Control-Allow-Origin", "*") + response.setHeader("Access-Control-Allow-Methods", "GET") + response.setHeader("Access-Control-Allow-Credentials", "true") + response.setHeader 'Strict-Transport-Security', 'max-age=300; preload' response.sendRedirect(AppUtil.instance.patchUrl(image.dataUrl, request)) } else {