From d9450b3dbe3498b58b15f09ccce7a470f0f7eef0 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 20 Feb 2018 10:44:47 +0100 Subject: [PATCH] Added CORS headers for media files --- assets.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets.go b/assets.go index 94b3e865..8230b3cd 100644 --- a/assets.go +++ b/assets.go @@ -45,16 +45,19 @@ func configureAssets(app *aero.Application) { // Favicon app.Get("/favicon.ico", func(ctx *aero.Context) string { + ctx.Response().Header().Set("Access-Control-Allow-Origin", "*") return ctx.File("images/brand/64.png") }) // Images app.Get("/images/*file", func(ctx *aero.Context) string { + ctx.Response().Header().Set("Access-Control-Allow-Origin", "*") return ctx.File("images" + ctx.Get("file")) }) // Videos app.Get("/videos/*file", func(ctx *aero.Context) string { + ctx.Response().Header().Set("Access-Control-Allow-Origin", "*") return ctx.File("videos" + ctx.Get("file")) })