Skip to content

Commit

Permalink
fixing base href (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
Heulitig committed Nov 7, 2023
1 parent f4c7939 commit 51cd1ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fastn-core/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,18 @@ async fn serve_file(
if fastn_core::utils::is_ftd_path(path.as_str()) {
return fastn_core::http::ok(main_document.content.as_bytes().to_vec());
}
let mut base_url = "/".to_string();
base_url.push_str(
path.as_str()
.trim_end_matches("/")

Check failure on line 99 in fastn-core/src/commands/serve.rs

View workflow job for this annotation

GitHub Actions / Rust Checks

single-character string constant used as pattern
.trim_start_matches("/")

Check failure on line 100 in fastn-core/src/commands/serve.rs

View workflow job for this annotation

GitHub Actions / Rust Checks

single-character string constant used as pattern
.trim_start_matches("index.html")
.trim_start_matches("index"),
);
match fastn_core::package::package_doc::read_ftd(
config,
&main_document,
"/",
base_url.as_str(),
false,
false,
)
Expand Down

0 comments on commit 51cd1ad

Please sign in to comment.