GRAILS-8809 fix for relative image URLs on windows #395

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

baseDir.absolutePath (line 50) returns on a windows system a path with backslashes. These will be removed by the replaceAll statement in line 60. A better way to create a file-URL from the basepath is to use baseDir.toPath().toUri().toString() which will return on *nix and windows systems a valid file-URL.
baseDir.toPath().toUri().toString() returns a trailing slash if baseDir is a directory, no slash otherwise. To ensure that we always have a trailing slash, I've added the line base += base.endsWith('/')?'':'/'

@rdmueller rdmueller GRAILS-8809 fix for relative image URLs on windows
baseDir.absolutePath (line 50) returns on a windows system a path with backslashes. These will be removed by the replaceAll statement in line 60. A better way to create a file-URL from the basepath is to use baseDir.toPath().toUri().toString() which will return on *nix and windows systems a valid file-URL.
baseDir.toPath().toUri().toString() returns a trailing slash if baseDir is a directory, no slash otherwise. To ensure that we always have a trailing slash, I've added the line
base += base.endsWith('/')?'':'/'
206e0dc
Member

lhotari commented Aug 8, 2014

Thanks for the pull request. Please open a new PR that targets the 2.3.x or 2.4.x branch. The master branch is currently for Grails 3.x development so that fixes going in to master won't be released in current stable Grails versions.

OK. Will try to come up with a proper pull request for the 2.2.x branch, since we are using this one. Hope this will be ok.
Do I also have to create PRs for 2.3.x and 2.4.x or will the PR for 2.2.x automatically show up in higher versions?

rdmueller closed this Aug 19, 2014

Member

lhotari commented Aug 21, 2014

@rdmueller We don't have plans to do maintenance releases for the 2.2.x branch any more and we don't merge 2.2.x to other branches.

Currently we merge 2.3.x to 2.4.x and 2.4.x to master so a pull request to 2.3.x branch is sufficient. You can also do a PR for the 2.2.x branch but as I said it's not under active maintenance anymore so the changes to 2.2.x might not get merged and released at all.

It would be interesting to know the reasons for keeping you from upgrading from 2.2.x to 2.4.x . If there are issues, please ask SO questions, report to the mailing list or Grails JIRA.

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