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( ...@@ -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()))
......
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