Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🥅 Validate
response-tagged
in the parser
The `response-tagged` parser now enforces `resp-cond-state`, raising `InvalidResponseError` for any invalid status conditions. It is also refactored to the new parser style. An explicit method for `tag` is added, which is parsed similarly to `astring_chars` and `atom`. ```abnf response-tagged = tag SP resp-cond-state CRLF resp-cond-state = ("OK" / "NO" / "BAD") SP resp-text ; Status condition tag = 1*<any ASTRING-CHAR except "+"> ``` Currently, any exception raised by the parser will abruptly drop the connection. In the future, if the response handler thread is made more robust against recoverable errors, `InvalidResponseError` should be considered non-recoverable. (There is a test that covers this already).
- Loading branch information