Skip to content

Conversation

@rosszurowski
Copy link

Description

This commit fixes an issue where the pathPrefix option was ignored when the trailing slash option was set to "never." The cause was that adding the prefix seemed to be left out of a few code paths.

Documentation

This feature is documented on this page, however, it doesn't work as described right now when the trailingSlash option is set to never.

Tests

I've tested this change on a production Gatsby site, but haven't added any automated tests. I'm happy to attempt to do so, but I couldn't get tests working locally, nor could I push to my fork (maybe because of the repository size).

Related Issues

Fixes #39043

This commit fixes an issue where the `pathPrefix` option was ignored when the trailing slash option was set to "never." The cause was that adding the prefix seemed to be left out of a few code paths.
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 18, 2024
@serhalp serhalp self-assigned this Nov 18, 2024
@serhalp serhalp added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 16, 2024

function absolutify(path, current) {
const prefixed = withPrefix(path)
// If it's already absolute, return as-is

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is no longer true so I'm wondering if line 24 should be return path instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trailing slash redirect broken when using path prefix

3 participants