fix CORS headers
@@ -91,9 +91,10 @@ func parseJSONBody(ctx *routing.Context, v interface{}) error {
func (ws *WebServer) addHeaders(ctx *routing.Context) error {
ctx.Response.Header.SetServer("shinpuru v." + util.AppVersion)
+ ctx.Response.Header.Set("X-Content-Type-Options", "nosniff")
if util.Release != "TRUE" {
- ctx.Response.Header.Set("Access-Control-Allow-Origin", "http://localhost:8081")
+ ctx.Response.Header.Set("Access-Control-Allow-Origin", ws.config.WebServer.PublicAddr)
ctx.Response.Header.Set("Access-Control-Allow-Headers", "authorization, content-type, set-cookie, cookie, server")
ctx.Response.Header.Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, POST, DELETE, OPTIONS")
ctx.Response.Header.Set("Access-Control-Allow-Credentials", "true")
