fix: address lab2 review feedback

This commit is contained in:
Fedoroff
2026-10-27 20:03:08 +03:00
parent c251f2cb7d
commit f08011385a
11 changed files with 280 additions and 82 deletions
+5
View File
@@ -53,6 +53,11 @@ func (h *SessionHandler) Create(w http.ResponseWriter, r *http.Request) {
`Basic realm="messenger", charset="UTF-8"`,
)
if err := requireEmptyBody(r); err != nil {
writeError(w, r, http.StatusBadRequest, "invalid_request", "request body must be empty")
return
}
username, password, ok := r.BasicAuth()
if !ok || username == "" || password == "" {
writeError(w, r, http.StatusUnauthorized,