upgrade shopify response Content-Security-Policy

master
ycfxx 3 years ago
parent eb5ed56488
commit 9c10d05462

@ -21,7 +21,7 @@ public class ShopifyRequestInfoInterceptor extends HandlerInterceptorAdapter {
if (AnnotatedElementUtils.isAnnotated(method, ShopifyEndpoint.class)) { if (AnnotatedElementUtils.isAnnotated(method, ShopifyEndpoint.class)) {
String shop = request.getParameter("shop"); String shop = request.getParameter("shop");
if (StringUtils.isNotBlank(shop)) { if (StringUtils.isNotBlank(shop)) {
response.addHeader("Content-Security-Policy", "frame-ancestors https://" + shop + ".myshopify.com https://admin.shopify.com"); response.addHeader("Content-Security-Policy", "frame-ancestors 'none'");
} }
} }
} }
@ -32,7 +32,7 @@ public class ShopifyRequestInfoInterceptor extends HandlerInterceptorAdapter {
JSONObject body = JSONObject.parseObject(requestBody); JSONObject body = JSONObject.parseObject(requestBody);
String shop = body.getString("shop_domain"); String shop = body.getString("shop_domain");
if (StringUtils.isNotBlank(shop)) { if (StringUtils.isNotBlank(shop)) {
response.addHeader("Content-Security-Policy", "frame-ancestors https://" + shop + ".myshopify.com https://admin.shopify.com"); response.addHeader("Content-Security-Policy", "frame-ancestors 'none'");
} }
} }
} }

Loading…
Cancel
Save