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

Basic Auth creates bad headers in crystal 0.29.0 #73

Closed
kalinon opened this issue Jun 18, 2019 · 2 comments
Closed

Basic Auth creates bad headers in crystal 0.29.0 #73

kalinon opened this issue Jun 18, 2019 · 2 comments

Comments

@kalinon
Copy link
Contributor

kalinon commented Jun 18, 2019

The following error is thrown when trying to use the Halite.basic_auth function.

       Header content contains invalid character '\n' (ArgumentError)
         from /usr/local/Cellar/crystal/0.29.0/src/http/headers.cr:303:7 in 'check_invalid_header_content'
         from /usr/local/Cellar/crystal/0.29.0/src/http/headers.cr:108:5 in 'add'
         from lib/halite/src/halite/ext/http_headers_encode.cr:27:11 in 'encode'
         from lib/halite/src/halite/options.cr:387:9 in 'parse_headers'
         from lib/halite/src/halite/options.cr:130:23 in 'with_headers'
         from lib/halite/src/halite/chainable.cr:163:7 in 'headers'
         from lib/halite/src/halite/chainable.cr:130:7 in 'auth'
         from lib/halite/src/halite/chainable.cr:120:7 in 'basic_auth'

This is due to not using Base64.strict_encode which does not place a newline at the end of the output.

@icyleaf
Copy link
Owner

icyleaf commented Jun 19, 2019

Updated in PR, File an issue with any question.

@kalinon
Copy link
Contributor Author

kalinon commented Jun 19, 2019

Merged and resolved

@kalinon kalinon closed this as completed Jun 19, 2019
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

No branches or pull requests

2 participants