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

Parse Header Error on peer response #24

Open
Jovonni opened this issue Apr 11, 2020 · 0 comments
Open

Parse Header Error on peer response #24

Jovonni opened this issue Apr 11, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Jovonni
Copy link
Contributor

Jovonni commented Apr 11, 2020

Error(
    Hyper(
        Error(
            Parse(
                Header,
            ),
        ),
    ),
    "http://<IP>:<PORT><ENDPOINT>",
)

Executed by lines:

let response_result = format!( "HTTP/1.1 200 OK
\r\nContent-Length: 1000
\r\nContent-Type: application/json; charset=UTF-8
\r\n\r\n{}
\r\n", result );

Format should follow

HTTP-Version Status-Code Reason-Phrase CRLF
headers CRLF
message-body

as shown in:
https://doc.rust-lang.org/book/ch20-01-single-threaded.html#writing-a-response

Example response:
HTTP/1.1 200 OK

@Jovonni Jovonni added the bug Something isn't working label Apr 11, 2020
@Jovonni Jovonni self-assigned this Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant