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;
44pub mod wasi_2023_10_18;
55pub mod wasi_2023_11_10;
66
7- use std:: { net :: SocketAddr , sync:: Arc } ;
7+ use std:: sync:: Arc ;
88
99use anyhow:: Context ;
1010use http:: {
@@ -138,13 +138,12 @@ pub struct SelfRequestOrigin {
138138}
139139
140140impl SelfRequestOrigin {
141- pub fn create ( scheme : Scheme , addr : & SocketAddr ) -> anyhow:: Result < Self > {
141+ pub fn create ( scheme : Scheme , auth : & str ) -> anyhow:: Result < Self > {
142142 Ok ( SelfRequestOrigin {
143143 scheme,
144- authority : addr
145- . to_string ( )
144+ authority : auth
146145 . parse ( )
147- . with_context ( || format ! ( "address '{addr }' is not a valid authority" ) ) ?,
146+ . with_context ( || format ! ( "address '{auth }' is not a valid authority" ) ) ?,
148147 } )
149148 }
150149
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ impl<F: RuntimeFactors> HttpServer<F> {
244244 . context (
245245 "The wasi HTTP trigger was configured without the required wasi outbound http support" ,
246246 ) ?;
247- let origin = SelfRequestOrigin :: create ( server_scheme, & self . listen_addr ) ?;
247+ let origin = SelfRequestOrigin :: create ( server_scheme, & self . listen_addr . to_string ( ) ) ?;
248248 outbound_http. set_self_request_origin ( origin) ;
249249 outbound_http. set_request_interceptor ( OutboundHttpInterceptor :: new ( self . clone ( ) ) ) ?;
250250
You can’t perform that action at this time.
0 commit comments