Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove '\r' from data before splitting with '\n' #47

Closed
wants to merge 1 commit into from

Conversation

rafaeljusto
Copy link
Contributor

According to RFC 2616 (section 2.2) the HTTP header line break is '\r\n', causing issues when splitting only by '\n'. The remaining '\r' special characters were not matching with the snapshot.

According to RFC 2616 (section 2.2) the HTTP header line break is '\r\n',
causing issues when splitting only by '\n'. The remaining '\r' special
characters were not matching with the snapshot.
@rafaeljusto
Copy link
Contributor Author

This issue occurs because git replaces the \r\n in the snapshots:

warning: CRLF will be replaced by LF in .../example.snapshot.

@sjkaliski Have you ever had any problem with that?

@rafaeljusto
Copy link
Contributor Author

Solved this issue adding a config in .gitattributes:

*.snapshot binary

With that git will not try to change the line break.

@rafaeljusto rafaeljusto deleted the fix/header-line-break branch August 29, 2018 17:03
@amir20
Copy link

amir20 commented Nov 29, 2018

This also fixed my issue. It was working locally but when checked in and ran on Travis, it would fail. Since this is probably so common for folks who use git, should this be added to the README file?

@rafaeljusto
Copy link
Contributor Author

@amir20 Yeah, I think it would be great to have this on README. 👍

@sjkaliski
Copy link
Collaborator

@amir20 @rafaeljusto PRs welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants