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

reland #12332: refactor(ext/http): rewrite hyper integration and fix bug #12732

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

piscisaureus
Copy link
Member

No description provided.

@@ -84,6 +84,11 @@
throw error;
}
if (nextRequest == null) {
// Work-around for servers (deno_std/http in particular) that call
Copy link
Member Author

@piscisaureus piscisaureus Nov 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is indicative of a problem with our API, in particular two dubious practices clash here:

  • HttpConn is automatically closed when HttpConn.nextRequest() fails or returns null.
  • Deno.upgradeWebSocket() doesn't actually do anything until the caller uses (returns) the response created by Deno.upgradeWebSocket().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deno.upgradeWebSocket() doesn't actually do anything until the caller uses (returns) the response created by Deno.upgradeWebSocket()

Why is this a problem? This was done intentionally. The Deno.upgradeWebSocket call is just a glorified new Response().

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// https://github.com/denoland/deno/pull/12732
unitTest(
{ permissions: { net: true } },
async function httpConnAutoCloseDelayedOnUpgrade() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression test for the deno_std/http problem that got #12332 reverted.

@piscisaureus piscisaureus merged commit 72a6231 into denoland:main Nov 10, 2021
@piscisaureus piscisaureus deleted the http branch November 10, 2021 23:19
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

Successfully merging this pull request may close these issues.

None yet

3 participants