use CRLF as newline characters

This commit is contained in:
Vincent Breitmoser 2017-08-31 23:02:49 +02:00
parent 46161efce6
commit dea3678fbe
2 changed files with 3 additions and 3 deletions

View file

@ -57,7 +57,7 @@ class AutocryptHeader {
int autocryptHeaderLength = autocryptHeaderString.length();
for (int i = 0; i < autocryptHeaderLength; i += HEADER_LINE_LENGTH) {
if (i + HEADER_LINE_LENGTH <= autocryptHeaderLength) {
headerLines.append(autocryptHeaderString, i, i + HEADER_LINE_LENGTH).append("\n ");
headerLines.append(autocryptHeaderString, i, i + HEADER_LINE_LENGTH).append("\r\n ");
} else {
headerLines.append(autocryptHeaderString, i, autocryptHeaderLength);
}

View file

@ -31,8 +31,8 @@ public class AutocryptHeaderTest {
public void toRawHeaderString_returnsExpected() throws Exception {
String autocryptHeaderString = autocryptHeader.toRawHeaderString();
String expected = "Autocrypt: addr=addr;prefer-encrypt=mutual;keydata=dGhlc2VhcmUxMjBjaGFyYWN0Z\n" +
" XJzeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e\n" +
String expected = "Autocrypt: addr=addr;prefer-encrypt=mutual;keydata=dGhlc2VhcmUxMjBjaGFyYWN0Z\r\n" +
" XJzeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e\r\n" +
" Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4";
assertEquals(expected, autocryptHeaderString);
}