diff --git a/src/mime.rs b/src/mime.rs index b497224..63d6115 100644 --- a/src/mime.rs +++ b/src/mime.rs @@ -44,6 +44,6 @@ impl ToString for MimeType { /// 'text' mime types require CRLF line ending according to /// RFC-2046, however the platform line terminator and what applications /// expect is LF. -pub fn normilize_to_lf(text: String) -> String { +pub fn normalize_to_lf(text: String) -> String { text.replace("\r\n", "\n").replace("\r", "\n") } diff --git a/src/worker/handlers.rs b/src/worker/handlers.rs index 347b626..bbdc308 100644 --- a/src/worker/handlers.rs +++ b/src/worker/handlers.rs @@ -51,7 +51,7 @@ macro_rules! handle_load { let mut contents = String::new(); let result = reader.read_to_string(&mut contents).map(|_| { if mime_type == MimeType::Utf8String { - mime::normilize_to_lf(contents) + mime::normalize_to_lf(contents) } else { contents }