DEV: apply allow origin response header for CDN requests. (#11893)

Currently, it creates a CORS error while accessing those static files.
This commit is contained in:
Vinoth Kannan
2021-01-29 07:44:49 +05:30
committed by GitHub
parent 4af4d36175
commit a5923ad603
12 changed files with 62 additions and 6 deletions

View File

@ -8,7 +8,7 @@ class UploadsController < ApplicationController
skip_before_action :preload_json, :check_xhr, :redirect_to_login_if_required, only: [:show, :show_short, :show_secure]
protect_from_forgery except: :show
before_action :is_asset_path, only: [:show, :show_short, :show_secure]
before_action :is_asset_path, :apply_cdn_headers, only: [:show, :show_short, :show_secure]
SECURE_REDIRECT_GRACE_SECONDS = 5