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

decode_status_line returns {error,status_line} when HTTP request contains query parameters and is sent to Cowboy #9

Closed
thomas-rc-hutchinson opened this issue Feb 16, 2016 · 1 comment

Comments

@thomas-rc-hutchinson
Copy link

To recreate start a shell (with fusco in code path) and run

{ok, Client} = fusco:start_link("http://127.0.0.1:8085", []).
fusco:request(Client, <<"/http_response?response_status=200">>, "GET", [], [], 1, 10000).

The host and path must refer to a cowboy app, also include a query parameter. The request will be processed but the fusco:request will return a {error,status_line}. Some digging revealed it was because no match could be found on fusco_protocol:decode_status_line causing it to return this.

% fusco_protocol:decode_status_line(<<"HTTP/1.1 200\r\nconnection: keep-alive\r\nserver: Cowboy\r\ndate: Tue, 16 Feb 2016 10:37:13 GMT\r\ncontent-length: 0\r\n\r\n">>, {response,#Port<0.4686>,false,undefined,undefined,undefined,[],undefined,[],0,
          112,
          {1455,619033,814280},
          undefined,undefined}, 10000)

% 10:32:38 <0.551.0>({fusco,init,1})
% fusco_protocol:decode_status_line/3 -> {error,status_line}

Investigate what caused this and also see if this could apply to other web servers.

@thomas-rc-hutchinson
Copy link
Author

No issue, problem was that the server wasn't returning a Content-Type header.

Still a more meaningful message would be nice. Closing ticket.

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

1 participant