diff options
-rw-r--r-- | lib/auth.ml | 2 | ||||
-rw-r--r-- | test/js/websockets_hello.ml | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/auth.ml b/lib/auth.ml index 450c89b..c1486d6 100644 --- a/lib/auth.ml +++ b/lib/auth.ml @@ -4,9 +4,11 @@ type auth_mechanism = PLAIN [@@deriving show { with_path = false }] type sasl_error = | NotAuthorized + | MalformedRequest let read_sasl_error = function | "not-authorized" -> NotAuthorized + | "malformed-request" -> MalformedRequest | _ -> failwith "Unsupported SASL error returned by the server." type sasl_auth = (string option, sasl_error * (string * string) option) result diff --git a/test/js/websockets_hello.ml b/test/js/websockets_hello.ml index 9043501..fb88e04 100644 --- a/test/js/websockets_hello.ml +++ b/test/js/websockets_hello.ml @@ -23,7 +23,8 @@ let main (stream, push) = Auth.PLAIN in push None; match _auth with - | Error (NotAuthorized, Some ("en", text)) -> print_endline text + | Error (NotAuthorized, Some (_, text)) -> print_endline ("Not authorized: " ^ text) + | Error (MalformedRequest, Some (_, text)) -> print_endline ("Malformed request: " ^ text) | _ -> () let () = |