Skip to content

Bugfix: Force close node server upon finishing response#36

Open
mina-asham wants to merge 1 commit intokriasoft:mainfrom
mina-asham:mina/update-node-shutdown
Open

Bugfix: Force close node server upon finishing response#36
mina-asham wants to merge 1 commit intokriasoft:mainfrom
mina-asham:mina/update-node-shutdown

Conversation

@mina-asham
Copy link
Copy Markdown
Contributor

Testing

  1. Added this sample script: examples/demo-node.js
import { getAuthCode } from "../dist/index.js";

const result = await getAuthCode({
  authorizationUrl: "https://github.com",
  port: 1234,
  openBrowser: true,
  timeout: 5 * 60 * 1000, // 5 minutes
});

console.log(result);
  1. Used this to run: npm run build && node examples/demo-node.js
  2. Opened this page manually: http://localhost:1234/callback?code=123&status=456

- Relying on clients using the connection close header to close the connection leaves room for client bugs where the server can just hang until the timeout passes, this force clauses the connection completely from the server side but after flushing all the response data
- Follow up to: kriasoft#25
- Fixes: kriasoft#35
@mina-asham
Copy link
Copy Markdown
Contributor Author

@koistya any chance you can review this soon? 🙏

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.

Bugfix: NodeCallbackServer not shutting down

1 participant