Made IrcCodec::sanitize part of the public API and improved documentation a bit.
This commit is contained in:
parent
625b59d605
commit
b452921a03
1 changed files with 3 additions and 3 deletions
|
@ -18,9 +18,9 @@ impl IrcCodec {
|
|||
}
|
||||
|
||||
/// Sanitizes the input string by cutting up to (and including) the first occurence of a line
|
||||
/// terminiating phrase (`\r\n`, `\r`, or `\n`). This is used in sending messages back to
|
||||
/// prevent the injection of additional commands.
|
||||
pub(crate) fn sanitize(mut data: String) -> String {
|
||||
/// terminiating phrase (`\r\n`, `\r`, or `\n`). This is used in sending messages through the
|
||||
/// codec to prevent the injection of additional commands.
|
||||
pub fn sanitize(mut data: String) -> String {
|
||||
// n.b. ordering matters here to prefer "\r\n" over "\r"
|
||||
if let Some((pos, len)) = ["\r\n", "\r", "\n"]
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue