package network
import (
"net/http"
owlconfig "github.com/xssed/owlcache/config"
owlsystem "github.com/xssed/owlcache/system"
owltools "github.com/xssed/owlcache/tools"
)
type ServerEntity struct {
handler http.Handler
}
func (se *ServerEntity) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", owltools.JoinString("owlcache ", owlsystem.VERSION))
if owlconfig.OwlConfigModel.Cors == "1" {
w.Header().Set("Access-Control-Allow-Origin", owlconfig.OwlConfigModel.Access_Control_Allow_Origin)
}
se.handler.ServeHTTP(w, r)
}