mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Fix JSON.parse console error (#2943)
This commit is contained in:
@@ -181,18 +181,16 @@ func Start() error {
|
|||||||
})
|
})
|
||||||
r.HandleFunc("/customlocales", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/customlocales", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
if !c.GetCustomLocalesEnabled() {
|
if c.GetCustomLocalesEnabled() {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// search for custom-locales.json in current directory, then $HOME/.stash
|
// search for custom-locales.json in current directory, then $HOME/.stash
|
||||||
fn := c.GetCustomLocalesPath()
|
fn := c.GetCustomLocalesPath()
|
||||||
exists, _ := fsutil.FileExists(fn)
|
exists, _ := fsutil.FileExists(fn)
|
||||||
if !exists {
|
if exists {
|
||||||
|
http.ServeFile(w, r, fn)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
http.ServeFile(w, r, fn)
|
_, _ = w.Write([]byte("{}"))
|
||||||
})
|
})
|
||||||
|
|
||||||
r.HandleFunc("/login*", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/login*", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user