fuckin CORS

This commit is contained in:
24c02 2026-02-26 15:17:51 -05:00
parent 6e2a751587
commit 734865378b

View file

@ -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