Skip to content

Commit 8a1efb5

Browse files
committed
fix: fixed serving bug with index page
I forgot to remove two if statements in a previous commit!
1 parent 3a54f40 commit 8a1efb5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

packages/perseus/src/server/render.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,7 @@ pub async fn get_page_for_template<M: MutableStore, T: TranslationsManager>(
376376
.get_translator_for_locale(locale.to_string())
377377
.await?;
378378

379-
let mut path = raw_path;
380-
// If the path is empty, we're looking for the special `index` page
381-
if path.is_empty() {
382-
path = "index";
383-
}
379+
let path = raw_path;
384380
// Remove `/` from the path by encoding it as a URL (that's what we store) and
385381
// add the locale
386382
let path_encoded = format!("{}-{}", locale, urlencoding::encode(path));
@@ -679,11 +675,7 @@ pub async fn get_page<M: MutableStore, T: TranslationsManager>(
679675
templates: &TemplateMap<SsrNode>,
680676
render_html: bool,
681677
) -> Result<PageData, ServerError> {
682-
let mut path = props.raw_path;
683-
// If the path is empty, we're looking for the special `index` page
684-
if path.is_empty() {
685-
path = "index";
686-
}
678+
let path = props.raw_path;
687679
// Get the template to use
688680
let template = templates.get(template_name);
689681
let template = match template {

0 commit comments

Comments
 (0)