Skip to content

Commit d383eab

Browse files
authored
fix(gatsby): Apply never trailing slash to xml & pdf (#35681)
1 parent 47cc3cb commit d383eab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gatsby-page-utils/src/apply-trailing-slash-option.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ export const applyTrailingSlashOption = (
66
option: TrailingSlash = `legacy`
77
): string => {
88
const hasHtmlSuffix = input.endsWith(`.html`)
9+
const hasXmlSuffix = input.endsWith(`.xml`)
10+
const hasPdfSuffix = input.endsWith(`.pdf`)
11+
912
if (input === `/`) return input
10-
if (hasHtmlSuffix) {
13+
if (hasHtmlSuffix || hasXmlSuffix || hasPdfSuffix) {
1114
option = `never`
1215
}
1316
if (option === `always`) {

0 commit comments

Comments
 (0)