-
Notifications
You must be signed in to change notification settings - Fork 638
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
[http] Handle aborted http Requests #450
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,6 +364,11 @@ test(async function testReadRequestError(): Promise<void> { | |
in: "HEAD / HTTP/1.1\r\nContent-Length:0\r\nContent-Length: 0\r\n\r\n", | ||
headers: [{ key: "Content-Length", value: "0" }], | ||
err: null | ||
}, | ||
11: { | ||
in: "ToTAlly \\ Non REAdable HTTTTTTp pRotOcOlz", | ||
err: "EOF", | ||
headers: [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't demonstrate the error. When I run it without your other change, it passes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mm you're right. We may work on a way to mock the request flow in the test runner. I'll try to find a way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you looked at these tests? https://github.com/golang/go/blob/master/src/net/http/requestwrite_test.go They're quite nice. I think we need to add ResponseWriter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case it will not be revelant because we will not write the response. But yes it would be a good addition sure. Adding this in another PR? |
||
} | ||
}; | ||
for (const p in testCases) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still run the risk of responding to the previous request.
This could be fixed by adding
req = undefined
to the start of the while loop above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH i don't know if this case could happen. As i haven't found a way to test it. I trust you on this.