1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

chore: more small lint/perf fixes (#493)

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2024-02-16 16:53:50 -08:00
committed by GitHub
parent f76b93a8f2
commit 33784cbb94
11 changed files with 40 additions and 38 deletions

View File

@@ -5,7 +5,6 @@ import (
"net/http"
"os"
"github.com/inbucket/inbucket/v3/pkg/config"
"github.com/rs/zerolog/log"
)
@@ -86,13 +85,13 @@ func requestLoggingWrapper(next http.Handler) http.Handler {
}
// spaTemplateHandler creates a handler to serve the index.html template for our SPA.
func spaTemplateHandler(tmpl *template.Template, basePath string,
webConfig config.Web) http.Handler {
func spaTemplateHandler(tmpl *template.Template, basePath string) http.Handler {
tmplData := struct {
BasePath string
}{
BasePath: basePath,
}
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
// ensure we do now allow click jacking
w.Header().Set("X-Frame-Options", "SameOrigin")