Prevent favicon requests
This commit is contained in:
parent
0e87c4d038
commit
8eea1e5cb0
@ -11,6 +11,7 @@
|
|||||||
<title>Dispatch</title>
|
<title>Dispatch</title>
|
||||||
|
|
||||||
<link href="/<%== cssPath %>" rel="stylesheet">
|
<link href="/<%== cssPath %>" rel="stylesheet">
|
||||||
|
<link rel="icon" href="data:;base64,=">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
func IndexTemplate(w io.Writer, data *indexData, cssPath, jsPath string) error {
|
func IndexTemplate(w io.Writer, data *indexData, cssPath, jsPath string) error {
|
||||||
io.WriteString(w, "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Dispatch</title><link href=\"/")
|
io.WriteString(w, "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Dispatch</title><link href=\"/")
|
||||||
io.WriteString(w, cssPath )
|
io.WriteString(w, cssPath )
|
||||||
io.WriteString(w, "\" rel=\"stylesheet\"></head><body><div id=\"root\"></div><script id=\"env\" type=\"application/json\">")
|
io.WriteString(w, "\" rel=\"stylesheet\"><link rel=\"icon\" href=\"data:;base64,=\"></head><body><div id=\"root\"></div><script id=\"env\" type=\"application/json\">")
|
||||||
json.NewEncoder(w).Encode(data)
|
json.NewEncoder(w).Encode(data)
|
||||||
io.WriteString(w, "</script><script src=\"/")
|
io.WriteString(w, "</script><script src=\"/")
|
||||||
io.WriteString(w, jsPath )
|
io.WriteString(w, jsPath )
|
||||||
|
@ -142,7 +142,7 @@ func serveIndex(w http.ResponseWriter, r *http.Request) {
|
|||||||
connectSrc = "ws://" + r.Host
|
connectSrc = "ws://" + r.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Security-Policy", "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src "+connectSrc)
|
w.Header().Set("Content-Security-Policy", "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src data:; connect-src "+connectSrc)
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
|
Loading…
Reference in New Issue
Block a user