File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ mod wasi;
4
4
pub mod wasi_2023_10_18;
5
5
pub mod wasi_2023_11_10;
6
6
7
- use std:: { net :: SocketAddr , sync:: Arc } ;
7
+ use std:: sync:: Arc ;
8
8
9
9
use anyhow:: Context ;
10
10
use http:: {
@@ -138,13 +138,12 @@ pub struct SelfRequestOrigin {
138
138
}
139
139
140
140
impl SelfRequestOrigin {
141
- pub fn create ( scheme : Scheme , addr : & SocketAddr ) -> anyhow:: Result < Self > {
141
+ pub fn create ( scheme : Scheme , auth : & str ) -> anyhow:: Result < Self > {
142
142
Ok ( SelfRequestOrigin {
143
143
scheme,
144
- authority : addr
145
- . to_string ( )
144
+ authority : auth
146
145
. parse ( )
147
- . with_context ( || format ! ( "address '{addr }' is not a valid authority" ) ) ?,
146
+ . with_context ( || format ! ( "address '{auth }' is not a valid authority" ) ) ?,
148
147
} )
149
148
}
150
149
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ impl<F: RuntimeFactors> HttpServer<F> {
244
244
. context (
245
245
"The wasi HTTP trigger was configured without the required wasi outbound http support" ,
246
246
) ?;
247
- let origin = SelfRequestOrigin :: create ( server_scheme, & self . listen_addr ) ?;
247
+ let origin = SelfRequestOrigin :: create ( server_scheme, & self . listen_addr . to_string ( ) ) ?;
248
248
outbound_http. set_self_request_origin ( origin) ;
249
249
outbound_http. set_request_interceptor ( OutboundHttpInterceptor :: new ( self . clone ( ) ) ) ?;
250
250
You can’t perform that action at this time.
0 commit comments