0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

Fix: remove odd /1/ check on RSS canonicals (#6970)

* fix: remove odd `/1/` check on RSS canonicals

* chore: changeset
This commit is contained in:
Ben Holmes 2023-05-02 13:48:44 -04:00 committed by GitHub
parent b6797fc858
commit b5482cee23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/rss": patch
---
Fix: remove accidental stripping of trailing `/1/` on canonical URLs

View file

@ -8,7 +8,6 @@ export function createCanonicalURL(
base?: string
): URL {
let pathname = url.replace(/\/index.html$/, ''); // index.html is not canonical
pathname = pathname.replace(/\/1\/?$/, ''); // neither is a trailing /1/ (impl. detail of collections)
if (trailingSlash === false) {
// remove the trailing slash
pathname = pathname.replace(/(\/+)?$/, '');