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

Bug: Ethon adapter fails when response headers are empty #67

Closed
RKushnir opened this issue Jan 28, 2019 · 2 comments
Closed

Bug: Ethon adapter fails when response headers are empty #67

RKushnir opened this issue Jan 28, 2019 · 2 comments

Comments

@RKushnir
Copy link
Contributor

When using the Ethon adapter and when the response_headers is an empty string, this code produces nil

# Hard to believe that Ethon wouldn't parse out the headers into
# an array; probably overlooked it. Anyway, let's do it ourselves:
headers = response_headers.split(/\r?\n/)[1..-1]

which then causes a crash when calling map on it:

response_headers: headers.map{ |header| header.split(/:\s/) }.to_h,

@trusche
Copy link
Owner

trusche commented Jan 28, 2019

Hmm. Hard to write a test for, since it takes some doing to send a HTTP response without any headers :) Anyway, this should fix it, can you give it a whirl from master?

@RKushnir
Copy link
Contributor Author

@trusche Works good, thank you. Could you make a new release?

trusche pushed a commit that referenced this issue Jan 28, 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