File tree 1 file changed +5
-5
lines changed
runtimes/core/src/api/gateway 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ pub struct GatewayCtx {
47
47
}
48
48
49
49
impl GatewayCtx {
50
- fn with_path ( & self , uri : & http :: Uri ) -> anyhow:: Result < http:: Uri > {
50
+ fn upsteam_uri ( & self , req : & RequestHeader ) -> anyhow:: Result < http:: Uri > {
51
51
let mut builder = http:: Uri :: builder ( ) ;
52
- if let Some ( scheme) = uri. scheme ( ) {
52
+ if let Some ( scheme) = req . uri . scheme ( ) {
53
53
builder = builder. scheme ( scheme. clone ( ) ) ;
54
54
}
55
- if let Some ( authority) = uri. authority ( ) {
55
+ if let Some ( authority) = req . uri . authority ( ) {
56
56
builder = builder. authority ( authority. clone ( ) ) ;
57
57
}
58
58
59
- let path_and_query = if let Some ( query) = uri. query ( ) {
59
+ let path_and_query = if let Some ( query) = req . uri . query ( ) {
60
60
format ! ( "{}?{}" , self . upstream_path, query)
61
61
} else {
62
62
self . upstream_path . clone ( )
@@ -384,7 +384,7 @@ impl ProxyHttp for GatewayServer {
384
384
{
385
385
if let Some ( gateway_ctx) = ctx. as_ref ( ) {
386
386
let new_uri = gateway_ctx
387
- . with_path ( & upstream_request. uri )
387
+ . upsteam_uri ( & upstream_request)
388
388
. or_err ( ErrorType :: InternalError , "failed to set upstream base path" ) ?;
389
389
390
390
upstream_request. set_uri ( new_uri) ;
You can’t perform that action at this time.
0 commit comments