Allow \r\n and \n line breaks for Connection::Buffer
* Nomad sends CRLF-separated lines * AWS sends LF-separated lines
This commit is contained in:
@ -71,8 +71,8 @@ class Runner::Connection::Buffer
|
|||||||
@buffering = false
|
@buffering = false
|
||||||
@global_buffer = +''
|
@global_buffer = +''
|
||||||
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
|
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
|
||||||
# Thus, we now re-add the `\n` at the end of the string and remove the `\r` at the same time.
|
# Thus, we now re-add the `\n` at the end of the string and (optionally) remove a trailing `\r` at the same time.
|
||||||
message = message.gsub(/\r$/, "\n")
|
message = message.gsub(/\r?$/, "\n")
|
||||||
@line_buffer.push message
|
@line_buffer.push message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user