Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing base href #1457

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading