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

feat(http): allow custom OutgoingHandler implementations #6272

Closed

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Apr 24, 2023

  • Remove unused variables and functions

  • Fix URI construction (partially)

Follow-up on #5929 #6228
cc @brendandburns @pchickey

- Remove unused variables and functions
- Fix URI construction

Signed-off-by: Roman Volosatovs <[email protected]>
This should be redundant, but is required by the existing Wasmtime design

Signed-off-by: Roman Volosatovs <[email protected]>
@rvolosatovs rvolosatovs marked this pull request as ready for review April 24, 2023 15:59
@rvolosatovs rvolosatovs requested review from a team as code owners April 24, 2023 15:59
@rvolosatovs rvolosatovs requested review from jameysharp and removed request for a team April 24, 2023 15:59
@jameysharp jameysharp requested a review from pchickey April 24, 2023 16:13
@jameysharp
Copy link
Contributor

I think it makes the most sense for @pchickey to review this, but Pat, I'm happy to do it if you'd like me to.

@elliottt elliottt removed the request for review from a team April 25, 2023 17:04
@jameysharp jameysharp removed their request for review May 4, 2023 18:44
let mut req = Request::builder()
.method(method)
.uri(uri)
.header(hyper::header::HOST, &request.authority);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we really be injecting headers on behalf of the caller?

Copy link
Contributor

@pchickey pchickey May 11, 2023

Choose a reason for hiding this comment

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

I agree, the responsibility of setting the Host header should be on the user of this interface, rather than on the implementer. It is both valid and frequently useful to set a different host header than the authority the network connection is made to

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree as well, this logic was simply moved from existing implementation, will update

@brendandburns
Copy link
Contributor

one small comment, but generall LGTM.

What is the use-case for a user supplying their own handler? Different TLS implementations?

@rvolosatovs
Copy link
Member Author

one small comment, but generall LGTM.

What is the use-case for a user supplying their own handler? Different TLS implementations?

A custom TLS implementation (e.g. selecting a set of trust roots) is definitely one generally useful use case. Our use case at Cosmonic/wasmCloud is that we need to be able to determine at runtime whether the guest should be allowed to make outgoing HTTP requests at all or not

@rvolosatovs
Copy link
Member Author

Not necessary anymore now that we have #7288

@rvolosatovs rvolosatovs deleted the feat/http-config branch October 19, 2023 10:35
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.

4 participants