fix(admin): add favicon and page-aware titles
This commit is contained in:
@@ -36,6 +36,7 @@ var contentTypes = map[string]string{
|
||||
".mjs": "text/javascript; charset=utf-8",
|
||||
".css": "text/css; charset=utf-8",
|
||||
".html": "text/html; charset=utf-8",
|
||||
".ico": "image/x-icon",
|
||||
".woff2": "font/woff2",
|
||||
".woff": "font/woff",
|
||||
".svg": "image/svg+xml",
|
||||
|
||||
@@ -165,7 +165,7 @@ func TestAPIPathsAreDelegated(t *testing.T) {
|
||||
|
||||
func TestMissingFileWithExtensionIs404(t *testing.T) {
|
||||
h, _ := newTestHandler(t)
|
||||
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/favicon.ico", testPrefix + "/golem/missing.css"} {
|
||||
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/missing.ico", testPrefix + "/golem/missing.css"} {
|
||||
rec := get(h, target)
|
||||
if rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "summer-admin-base") {
|
||||
t.Fatalf("%s status=%d body=%s", target, rec.Code, rec.Body.String())
|
||||
@@ -276,6 +276,10 @@ func TestContentTypesAndCaching(t *testing.T) {
|
||||
if got := ContentType("x.svg"); got != "image/svg+xml" {
|
||||
t.Fatalf("svg type %q", got)
|
||||
}
|
||||
favicon := get(h, testPrefix+"/favicon.ico")
|
||||
if favicon.Code != http.StatusOK || favicon.Header().Get("Content-Type") != "image/x-icon" || favicon.Header().Get("Cache-Control") != "no-cache" {
|
||||
t.Fatalf("favicon headers = status %d, %v", favicon.Code, favicon.Header())
|
||||
}
|
||||
if got := ContentType("x.json"); got != "application/json" {
|
||||
t.Fatalf("json type %q", got)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user