Prevent favicon requests

This commit is contained in:
Ken-Håvard Lieng 2017-03-23 20:55:34 +01:00
parent 0e87c4d038
commit 8eea1e5cb0
3 changed files with 3 additions and 2 deletions

View File

@ -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>

View File

@ -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 )

View File

@ -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")