Send error code 401 on timeout
This commit is contained in:
parent
283946aa22
commit
731183c637
|
|
@ -52,8 +52,7 @@ GET /auth?jid=user%40host%2fresource&domain=example.org&method=POST&transaction_
|
|||
This will send a request to the given JID, then return HTTP code depending on what appended.
|
||||
* 200 : User accept the request
|
||||
* 400 : One or more mandatory parameter(s) is missing
|
||||
* 401 : User deny the request
|
||||
* 504 : User do not provide an answer (timeout)
|
||||
* 401 : User deny the request or timeout
|
||||
* 520 : Unknown error append
|
||||
* 523 : Server is unreachable
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func authHandler(w http.ResponseWriter, r *http.Request) {
|
|||
w.WriteHeader(StatusUnknownError)
|
||||
}
|
||||
case <-time.After(time.Duration(timeout) * time.Second):
|
||||
w.WriteHeader(http.StatusGatewayTimeout)
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
delete(xmpp.WaitMessageAnswers, transaction)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue