Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relURL with leading slash when baseURL includes a subdirectory #10002

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

bep
Copy link
Member

@bep bep commented Jun 13, 2022

Fixes #9994

@bep bep merged commit a5a4422 into gohugoio:master Jun 13, 2022
func (p *PathSpec) getBaseURLRoot(path string) string {
if strings.HasPrefix(path, "/") {
// Treat it as relative to the server root.
return p.BaseURLNoPathString
Copy link

Choose a reason for hiding this comment

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

This looks like a regression to me. p.BaseURLNoPathString is not the p.BaseURL we used to return, therefore the path is stripped here. relURL in turn will output an invalid path, which doesn't contain the path (/foo in helpers/pathspec_test.go)

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in relURL with leading slash when baseURL includes a subdirectory
2 participants