Use CRLF for newlines (#18)

* Update newlines to \r\n

* fix ndjson_stream newline change

---------

Co-authored-by: Foretack <69414142+Foretack@users.noreply.github.com>
Co-authored-by: boring_nick <boring-nick@users.noreply.github.com>
This commit is contained in:
boring-nick 2023-11-14 20:59:59 +02:00 committed by GitHub
parent 1171651732
commit 9732b9c474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ impl IntoResponse for LogsResponse {
match self.response_type {
LogsResponseType::Raw => {
let stream = self.stream.map_ok(|mut line| {
line.push('\n');
line.push_str("\r\n");
line
});

View File

@ -56,7 +56,7 @@ impl Stream for NdJsonLogsStream {
for message_buf in serialized_messages {
buf.extend(message_buf);
buf.push(b'\n');
buf.extend(b"\r\n");
}
Ok(buf)

View File

@ -37,8 +37,8 @@ impl Stream for TextLogsStream {
let irc_messages = parse_raw(chunk);
let messages: Vec<FullMessage> = parse_messages(&irc_messages).collect();
let mut text = messages.iter().join('\n').to_string();
text.push('\n');
let mut text = messages.iter().join("\r\n").to_string();
text.push_str("\r\n");
Ok(text)
}