@decocms/blocks 7.20.7 → 7.20.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sdk/redirects.ts +3 -0
package/package.json
CHANGED
package/src/sdk/redirects.ts
CHANGED
|
@@ -145,6 +145,9 @@ export function parseRedirectsCsv(csv: string): Redirect[] {
|
|
|
145
145
|
|
|
146
146
|
const [from, to, type] = parts;
|
|
147
147
|
if (!from || !to) continue;
|
|
148
|
+
// Skip a header row (`from,to[,type]`). Robust for CSVs with or without a
|
|
149
|
+
// header, and for a header repeated when multiple files are concatenated.
|
|
150
|
+
if (from.toLowerCase() === "from" && to.toLowerCase() === "to") continue;
|
|
148
151
|
|
|
149
152
|
redirects.push({
|
|
150
153
|
from: normalizePath(from),
|