fix(web): fix authorization handling
This commit is contained in:
parent
cc55219e46
commit
c9dc59ecec
@ -6,6 +6,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -92,7 +93,7 @@ func HandlerAuth(w http.ResponseWriter, r *http.Request) {
|
|||||||
log.Fatalf("Failed to close password file: %s\n", err)
|
log.Fatalf("Failed to close password file: %s\n", err)
|
||||||
}
|
}
|
||||||
_, err = r.Body.Read(buffer)
|
_, err = r.Body.Read(buffer)
|
||||||
if err != nil {
|
if err != nil && err != io.EOF {
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
defer log.Println("Bad authorization request")
|
defer log.Println("Bad authorization request")
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user