File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
runtimes/core/src/api/gateway Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ pub struct GatewayCtx {
4747}
4848
4949impl GatewayCtx {
50- fn with_path ( & self , uri : & http :: Uri ) -> anyhow:: Result < http:: Uri > {
50+ fn upsteam_uri ( & self , req : & RequestHeader ) -> anyhow:: Result < http:: Uri > {
5151 let mut builder = http:: Uri :: builder ( ) ;
52- if let Some ( scheme) = uri. scheme ( ) {
52+ if let Some ( scheme) = req . uri . scheme ( ) {
5353 builder = builder. scheme ( scheme. clone ( ) ) ;
5454 }
55- if let Some ( authority) = uri. authority ( ) {
55+ if let Some ( authority) = req . uri . authority ( ) {
5656 builder = builder. authority ( authority. clone ( ) ) ;
5757 }
5858
59- let path_and_query = if let Some ( query) = uri. query ( ) {
59+ let path_and_query = if let Some ( query) = req . uri . query ( ) {
6060 format ! ( "{}?{}" , self . upstream_path, query)
6161 } else {
6262 self . upstream_path . clone ( )
@@ -384,7 +384,7 @@ impl ProxyHttp for GatewayServer {
384384 {
385385 if let Some ( gateway_ctx) = ctx. as_ref ( ) {
386386 let new_uri = gateway_ctx
387- . with_path ( & upstream_request. uri )
387+ . upsteam_uri ( & upstream_request)
388388 . or_err ( ErrorType :: InternalError , "failed to set upstream base path" ) ?;
389389
390390 upstream_request. set_uri ( new_uri) ;
You can’t perform that action at this time.
0 commit comments