Skip to content

Commit

Permalink
Fix URL prefix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgb committed Dec 19, 2024
1 parent e1cb909 commit f3c9f6b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/y-sweet/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,12 @@ async fn auth_doc(
};

let base_url = if let Some(url_prefix) = &server_state.url_prefix {
format!("{url_prefix}/d/{doc_id}")
let mut url_prefix = url_prefix.to_string();
if !url_prefix.ends_with('/') {
url_prefix = format!("{url_prefix}/");
}

format!("{url_prefix}d/{doc_id}")
} else {
format!("http://{host}/d/{doc_id}")
};
Expand Down

0 comments on commit f3c9f6b

Please sign in to comment.