-
Notifications
You must be signed in to change notification settings - Fork 189
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
Simplifying snippetizer link URL construction #217
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
return toAppend.toString(); | ||
return req.getContextPath() + '/' + (i == null ? "" : i.getUrl()) + u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you manually tested both cases here?
} | ||
|
||
return toAppend.toString(); | ||
return req.getContextPath() + '/' + (i == null ? "" : i.getUrl()) + u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, why did we remove the check for if the context path has a '/' on it? We had an actual stage view bug that resulted from a similar issue.
Edit: even if it "shouldn't" happen it's a harmless check.
} | ||
|
||
return toAppend.toString(); | ||
return Paths.get( req.getContextPath(), i == null ? "" : i.getUrl(), u).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Paths
to concatenate class to handle slashes - will remove or add as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am little wary of using Path
for URLs, would it not result in file system-specific behavior? Maybe fine, I just haven't seen it used in this kind of context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you would be correct. 😄
4aaec74
to
af2dcd1
Compare
Minor cleanup after comments on #209