mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 15:18:15 +00:00
fuckin CORS
This commit is contained in:
parent
6e2a751587
commit
734865378b
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class ExternalUploadsController < ApplicationController
|
||||
skip_before_action :require_authentication!
|
||||
before_action :set_cors_headers
|
||||
|
||||
def show
|
||||
upload = Upload.includes(:blob).find(params[:id])
|
||||
|
|
@ -31,6 +32,8 @@ class ExternalUploadsController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def set_cors_headers = response.set_header("Access-Control-Allow-Origin", "*")
|
||||
|
||||
def render_not_found_response(url)
|
||||
if url.match?(/\.(png|jpe?g)$/i)
|
||||
render_error_image
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue