mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
lib/api: String comparisons
This commit is contained in:
parent
0c8b22c696
commit
6baa93e13f
@ -572,7 +572,7 @@ func loadRelays(file string) []*relay {
|
|||||||
|
|
||||||
var relays []*relay
|
var relays []*relay
|
||||||
for _, line := range strings.Split(string(content), "\n") {
|
for _, line := range strings.Split(string(content), "\n") {
|
||||||
if len(line) == 0 {
|
if line == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,7 +1017,7 @@ func (s *service) postSystemReset(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(folder) == 0 {
|
if folder == "" {
|
||||||
// Reset all folders.
|
// Reset all folders.
|
||||||
for folder := range s.cfg.Folders() {
|
for folder := range s.cfg.Folders() {
|
||||||
if err := s.model.ResetFolder(folder); err != nil {
|
if err := s.model.ResetFolder(folder); err != nil {
|
||||||
|
@ -81,7 +81,7 @@ func (s *staticsServer) serveAsset(w http.ResponseWriter, r *http.Request) {
|
|||||||
file = file[1:]
|
file = file[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(file) == 0 {
|
if file == "" {
|
||||||
file = "index.html"
|
file = "index.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ func (s *staticsServer) serveFromAssetDir(file, theme string, w http.ResponseWri
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
mtype := assets.MimeTypeForFile(file)
|
mtype := assets.MimeTypeForFile(file)
|
||||||
if len(mtype) != 0 {
|
if mtype == "" {
|
||||||
w.Header().Set("Content-Type", mtype)
|
w.Header().Set("Content-Type", mtype)
|
||||||
}
|
}
|
||||||
http.ServeFile(w, r, p)
|
http.ServeFile(w, r, p)
|
||||||
|
Loading…
Reference in New Issue
Block a user