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

Dispatcher.connect doesn't include origin field #2531

Closed
dvoytenko opened this issue Dec 20, 2023 · 3 comments · Fixed by #2532
Closed

Dispatcher.connect doesn't include origin field #2531

dvoytenko opened this issue Dec 20, 2023 · 3 comments · Fixed by #2532
Labels
bug Something isn't working Types Changes related to the TypeScript definitions

Comments

@dvoytenko
Copy link
Contributor

Bug Description

ConnectOptions interface doesn't include an origin field that's required for the HTTP CONNECT.

Furthermore, it appears that the agent.connect({}) currently fails to execute without the origin field.

Reproducible By

const agent = new Agent();
agent.connect({
  origin: "https://example.com",
  path: "/robots.txt"
 });

This gives a TypeScript error for unknown "origin" field.

Expected Behavior

Origin is accepted.

Environment

Any

@dvoytenko dvoytenko added the bug Something isn't working label Dec 20, 2023
@metcoder95 metcoder95 added the Types Changes related to the TypeScript definitions label Dec 20, 2023
@metcoder95
Copy link
Member

Would you like to send a PR?

@dvoytenko
Copy link
Contributor Author

@metcoder95 I took a stub at it in #2532. But not sure what to do with backward compat, so I left it an optional field.

@KhafraDev
Copy link
Member

Type changes are always considered minor changes, it's fine to make the field required (especially since it doesn't work without it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Types Changes related to the TypeScript definitions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants