Skip to content

Commit 928fa31

Browse files
committed
cleanup
1 parent 71f2ec4 commit 928fa31

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

runtimes/core/src/api/gateway/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ impl GatewayCtx {
5656
builder = builder.authority(authority.clone());
5757
}
5858

59-
let path_and_query = if let Some(query) = req.uri.query() {
60-
format!("{}?{}", self.upstream_path, query)
59+
if let Some(query) = req.uri.query() {
60+
builder = builder.path_and_query(format!("{}?{}", self.upstream_path, query));
6161
} else {
62-
self.upstream_path.clone()
62+
builder = builder.path_and_query(&self.upstream_path);
6363
};
6464

65-
builder = builder.path_and_query(path_and_query);
6665
builder.build().context("failed to build uri")
6766
}
6867
}
@@ -130,8 +129,8 @@ impl GatewayServer {
130129
}
131130
}
132131

133-
pub fn is_empty(&self) -> bool {
134-
self.gateways.is_empty()
132+
pub fn has_configurations(&self) -> bool {
133+
!self.gateways.is_empty()
135134
}
136135

137136
pub fn get_gateway(&self, name: &str) -> Option<&Arc<Gateway>> {
@@ -301,7 +300,7 @@ impl ProxyHttp for GatewayServer {
301300
target
302301
} else {
303302
return Err(api::Error::internal(anyhow::anyhow!(
304-
"route path was not prefixed with target service name"
303+
"path was not prefixed with target service name"
305304
))
306305
.into());
307306
}

runtimes/core/src/api/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl ManagerConfig<'_> {
162162
let routes = paths::compute(
163163
endpoints
164164
.iter()
165-
// TODO(fredr) we should filter out only public routs here
165+
// TODO(fredr): we should filter out only public routes here
166166
// .filter(|(_, ep)| ep.exposed.contains(name))
167167
.map(|(_, ep)| RoutePerService(ep.to_owned())),
168168
);

0 commit comments

Comments
 (0)