mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Response with Bad Request to bad config posts, not Internal Server Errors
The error is the clients fault, or so we think, so we should not accept the blame.
This commit is contained in:
parent
38e9b92c42
commit
415415b5b2
@ -578,7 +578,7 @@ func (s *apiSvc) postSystemConfig(w http.ResponseWriter, r *http.Request) {
|
|||||||
to, err := config.ReadJSON(r.Body, myID)
|
to, err := config.ReadJSON(r.Body, myID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln("decoding posted config:", err)
|
l.Warnln("decoding posted config:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ func (s *apiSvc) postSystemConfig(w http.ResponseWriter, r *http.Request) {
|
|||||||
hash, err := bcrypt.GenerateFromPassword([]byte(to.GUI.Password), 0)
|
hash, err := bcrypt.GenerateFromPassword([]byte(to.GUI.Password), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln("bcrypting password:", err)
|
l.Warnln("bcrypting password:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user