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

Simplifying snippetizer link URL construction #217

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abayer
Copy link
Member

@abayer abayer commented Apr 2, 2018

Minor cleanup after comments on #209

@abayer abayer requested review from jglick and svanoort April 2, 2018 15:52
}

return toAppend.toString();
return req.getContextPath() + '/' + (i == null ? "" : i.getUrl()) + u;
Copy link
Member

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;
Copy link
Member

@svanoort svanoort Apr 5, 2018

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();
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants