mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-23 14:28:51 +01:00
fix http error codes
This commit is contained in:
parent
b66e984ddd
commit
6a75ec4ab7
@ -112,12 +112,12 @@ func (h *PATHandler) CreateToken(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if req.Name == "" {
|
if req.Name == "" {
|
||||||
util.WriteErrorResponse("name can't be empty", status.InvalidArgument, w)
|
util.WriteErrorResponse("name can't be empty", http.StatusBadRequest, w)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.ExpiresIn < 1 || req.ExpiresIn > 365 {
|
if req.ExpiresIn < 1 || req.ExpiresIn > 365 {
|
||||||
util.WriteErrorResponse("expiration has to be between 1 and 365", status.InvalidArgument, w)
|
util.WriteErrorResponse("expiration has to be between 1 and 365", http.StatusBadRequest, w)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user