From e453bca309a56d38c46a2da5b76a71d5b7ec2947 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Thu, 12 Sep 2019 17:41:40 -0400 Subject: [PATCH] allow i18n file loading from any origin --- controller/action/i18nActions.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/action/i18nActions.class.php b/controller/action/i18nActions.class.php index 9526c9c9..dfd490a1 100644 --- a/controller/action/i18nActions.class.php +++ b/controller/action/i18nActions.class.php @@ -26,9 +26,11 @@ class i18nActions extends Actions public static function executeServeTranslationFile(string $project, string $resource, string $language) { if (!Transifex::isConfigured()) { - throw new Exception('Please set Config::TRANSIFEX_API_KEY in your configuration.'); + throw new Exception('Please set Config::TRANSIFEX_API_KEY in your configuration.'); } + Response::setHeader(Response::HEADER_CROSS_ORIGIN, "*"); + return View::renderJson(Transifex::getTranslationResourceFile($project, $resource, $language)); } }