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 {
|
||||
path
|
||||
};
|
||||
let path = if data {
|
||||
path
|
||||
let path = if path == "index" && !data {
|
||||
""
|
||||
} else {
|
||||
if path == "index" {
|
||||
""
|
||||
} else {
|
||||
path.strip_suffix("/index").unwrap_or(path)
|
||||
}
|
||||
path.strip_suffix("/index").unwrap_or(path)
|
||||
};
|
||||
|
||||
Ok(StringVc::cell(path.to_string()))
|
||||
|
|
Loading…
Reference in a new issue