Vojtech Szocs has posted comments on this change.
Change subject: userportal,webadmin: remove double slash in link
......................................................................
Patch Set 2:
(1 comment)
....................................................
File
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/utils/BaseContextPathData.java
Line 18: return this.value;
Line 19: }-*/;
Line 20:
Line 21: public String getRelativePath() {
Line 22: String path = getPath();
> If I assume that the value in the gwthost page will never ever be returned
> without a slash, yes. If I don't make that assumption no.
IIUC, ServletUtils.getBaseContextPath method will *always* return String that
starts with slash.
This is because ServletUtils.getBaseContextPath uses
request.getContextPath()
as "servletContextPath" argument when calling ServletUtils.getAsAbsoluteContext
method.
(As per Servlet API spec, HttpServletRequest.getContextPath always returns
String that starts with slash.)
Having said that, I'd rather prefer staying defensive and safe, i.e. if there
is leading double-slash, remove it:
path.replaceFirst("//", "/")
Line 23: if (path.startsWith("/")) { //$NON-NLS-1$
Line 24: path = path.substring(1);
Line 25: }
Line 26: return path;
--
To view, visit http://gerrit.ovirt.org/20931
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ica1ee3cce0c98dffe781b7d0e9ec5c2d667b4acd
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Greg Sheremeta <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches