fix pathname for data requests (vercel/turbo#4149)
### Description | input file | HTML pathname | Data pathname | | ------------------ | ------------- | ---------------- | | index.tsx | / | .../index.json | | blog.tsx | /blog | .../blog.json | | pricing/index.tsx | /pricing | .../pricing.json |
This commit is contained in:
parent
511b244f4a
commit
01f2524392
1 changed files with 3 additions and 7 deletions
|
@ -47,14 +47,10 @@ pub async fn pathname_for_path(
|
||||||
} else {
|
} else {
|
||||||
path
|
path
|
||||||
};
|
};
|
||||||
let path = if data {
|
let path = if path == "index" && !data {
|
||||||
path
|
""
|
||||||
} else {
|
} else {
|
||||||
if path == "index" {
|
path.strip_suffix("/index").unwrap_or(path)
|
||||||
""
|
|
||||||
} else {
|
|
||||||
path.strip_suffix("/index").unwrap_or(path)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(StringVc::cell(path.to_string()))
|
Ok(StringVc::cell(path.to_string()))
|
||||||
|
|
Loading…
Reference in a new issue