Skip to content

Commit d13b70d

Browse files
Remove catch-all redirect for UI
1 parent bee495c commit d13b70d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

josh-proxy/src/bin/josh-proxy.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,19 +1259,17 @@ async fn call_service(
12591259
}
12601260
pu
12611261
} else {
1262-
let redirect_path = if path == "/" {
1263-
"/~/ui/".to_string()
1262+
if path == "/" {
1263+
let redirect_path = "/~/ui/".to_string();
1264+
return Ok(Response::builder()
1265+
.status(hyper::StatusCode::FOUND)
1266+
.header("Location", redirect_path)
1267+
.body(Full::new(Bytes::new()))?);
12641268
} else {
1265-
format!(
1266-
"/~/ui/browse?repo={}.git&path=&filter=%3A%2F&rev=HEAD",
1267-
path
1268-
)
1269+
return Ok(Response::builder()
1270+
.status(hyper::StatusCode::NOT_FOUND)
1271+
.body(Full::new(Bytes::new()))?);
12691272
};
1270-
1271-
return Ok(Response::builder()
1272-
.status(hyper::StatusCode::FOUND)
1273-
.header("Location", redirect_path)
1274-
.body(Full::new(Bytes::new()))?);
12751273
}
12761274
};
12771275

0 commit comments

Comments
 (0)