mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 15:36:53 +00:00
Send an HTTP/440 response instead of an HTTP/502 if an upstream provider rejects a "send verification code" request
This commit is contained in:
1 parent
43fd8518c0
commit
5c31ef43c9
2 files changed
+4
-2
No files matched your search
+3
-1
@@ -12,9 +12,11 @@ import org.whispersystems.textsecuregcm.registration.RegistrationServiceSenderEx
|
||||
|
||||
public class RegistrationServiceSenderExceptionMapper implements ExceptionMapper<RegistrationServiceSenderException> {
|
||||
|
||||
public static int REMOTE_SERVICE_REJECTED_REQUEST_STATUS = 440;
|
||||
|
||||
@Override
|
||||
public Response toResponse(final RegistrationServiceSenderException exception) {
|
||||
return Response.status(Response.Status.BAD_GATEWAY)
|
||||
return Response.status(REMOTE_SERVICE_REJECTED_REQUEST_STATUS)
|
||||
.entity(new SendVerificationCodeFailureResponse(exception.getReason(), exception.isPermanent()))
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user