Commit 01f25243 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

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 |
parent 511b244f
......@@ -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()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment