refactor: fix code formatting and return flow

This commit is contained in:
yusing
2025-03-01 15:50:50 +08:00
parent 9b2ee628aa
commit f6dc432419
3 changed files with 5 additions and 5 deletions

View File

@@ -36,9 +36,8 @@ func (res *fetchResult) ContentType() string {
if res.contentType == "" {
if bytes.HasPrefix(res.icon, []byte("<svg")) || bytes.HasPrefix(res.icon, []byte("<?xml")) {
return "image/svg+xml"
} else {
return "image/x-icon"
}
return "image/x-icon"
}
return res.contentType
}

View File

@@ -39,9 +39,9 @@ func List(cfg config.ConfigInstance, w http.ResponseWriter, r *http.Request) {
switch what {
case ListRoute:
if route := listRoute(which); route == nil {
route := listRoute(which)
if route == nil {
http.NotFound(w, r)
return
} else {
U.RespondJSON(w, r, route)
}