Added CORS headers for media files
This commit is contained in:
parent
93337d65c4
commit
d9450b3dbe
@ -45,16 +45,19 @@ func configureAssets(app *aero.Application) {
|
|||||||
|
|
||||||
// Favicon
|
// Favicon
|
||||||
app.Get("/favicon.ico", func(ctx *aero.Context) string {
|
app.Get("/favicon.ico", func(ctx *aero.Context) string {
|
||||||
|
ctx.Response().Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
return ctx.File("images/brand/64.png")
|
return ctx.File("images/brand/64.png")
|
||||||
})
|
})
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
app.Get("/images/*file", func(ctx *aero.Context) string {
|
app.Get("/images/*file", func(ctx *aero.Context) string {
|
||||||
|
ctx.Response().Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
return ctx.File("images" + ctx.Get("file"))
|
return ctx.File("images" + ctx.Get("file"))
|
||||||
})
|
})
|
||||||
|
|
||||||
// Videos
|
// Videos
|
||||||
app.Get("/videos/*file", func(ctx *aero.Context) string {
|
app.Get("/videos/*file", func(ctx *aero.Context) string {
|
||||||
|
ctx.Response().Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
return ctx.File("videos" + ctx.Get("file"))
|
return ctx.File("videos" + ctx.Get("file"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user