Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 39bc74c

Browse files
feat: Stop proxying /_/raw (#26)
1 parent 0230bff commit 39bc74c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,14 @@ async fn handle_request(
632632
debug: bool,
633633
) -> Result<Response<Body>, Infallible> {
634634
let request_uri_path = request.uri().path();
635-
match if request_uri_path.starts_with("/api/") {
635+
let result = if request_uri_path.starts_with("/api/") {
636636
slog::debug!(
637637
logger,
638638
"URI Request to path '{}' being forwarded to Replica",
639639
&request.uri().path()
640640
);
641641
forward_api(&ip_addr, request, &replica_url).await
642-
} else if request_uri_path.starts_with("/_/") {
642+
} else if request_uri_path.starts_with("/_/") && !request_uri_path.starts_with("/_/raw") {
643643
if let Some(proxy_url) = proxy_url {
644644
slog::debug!(
645645
logger,
@@ -667,7 +667,9 @@ async fn handle_request(
667667
} else {
668668
forward_request(request, agent, dns_canister_config.as_ref(), logger.clone()).await
669669
}
670-
} {
670+
};
671+
672+
match result {
671673
Err(err) => {
672674
slog::warn!(logger, "Internal Error during request:\n{:#?}", err);
673675

0 commit comments

Comments
 (0)