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

Commit

Permalink
feat: Stop proxying /_/raw (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Bloom-dfinity authored Mar 4, 2022
1 parent 0230bff commit 39bc74c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,14 @@ async fn handle_request(
debug: bool,
) -> Result<Response<Body>, Infallible> {
let request_uri_path = request.uri().path();
match if request_uri_path.starts_with("/api/") {
let result = if request_uri_path.starts_with("/api/") {
slog::debug!(
logger,
"URI Request to path '{}' being forwarded to Replica",
&request.uri().path()
);
forward_api(&ip_addr, request, &replica_url).await
} else if request_uri_path.starts_with("/_/") {
} else if request_uri_path.starts_with("/_/") && !request_uri_path.starts_with("/_/raw") {
if let Some(proxy_url) = proxy_url {
slog::debug!(
logger,
Expand Down Expand Up @@ -667,7 +667,9 @@ async fn handle_request(
} else {
forward_request(request, agent, dns_canister_config.as_ref(), logger.clone()).await
}
} {
};

match result {
Err(err) => {
slog::warn!(logger, "Internal Error during request:\n{:#?}", err);

Expand Down

0 comments on commit 39bc74c

Please sign in to comment.