diff options
author | Thomas Watson | 2015-08-18 16:38:34 +0000 |
---|---|---|
committer | Thomas Watson | 2015-08-18 16:38:34 +0000 |
commit | 645b3d415d2e20ae2eaece1af23ba7fa144a9762 (patch) | |
tree | 099d1b5a3ddd77c79807986cdad3e2bdc59f163e /bundles/org.eclipse.equinox.http.servlet/src | |
parent | 88b017a97beecb2d019c32661efb07d74afa9223 (diff) | |
download | rt.equinox.bundles-645b3d415d2e20ae2eaece1af23ba7fa144a9762.tar.gz rt.equinox.bundles-645b3d415d2e20ae2eaece1af23ba7fa144a9762.tar.xz rt.equinox.bundles-645b3d415d2e20ae2eaece1af23ba7fa144a9762.zip |
Bug 474250 - Fix servlet alias unregister to take into account /*
appending
Change-Id: Ia67dd6dbf61c7762c4116122e4697419be6bf81a
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.http.servlet/src')
-rw-r--r-- | bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java index d9e7024d9..d363b698b 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java @@ -691,14 +691,14 @@ public class HttpServiceRuntimeImpl // check the pattern against the original input ContextController.checkPattern(alias); - String originalAlias = alias; + String pattern = alias; // need to make sure exact matching aliases are converted to wildcard pattern matches - if (!alias.endsWith(Const.SLASH_STAR) && !alias.startsWith(Const.STAR_DOT) && !alias.contains(Const.SLASH_STAR_DOT)) { - if (alias.endsWith(Const.SLASH)) { - alias = alias + '*'; + if (!pattern.endsWith(Const.SLASH_STAR) && !pattern.startsWith(Const.STAR_DOT) && !pattern.contains(Const.SLASH_STAR_DOT)) { + if (pattern.endsWith(Const.SLASH)) { + pattern = pattern + '*'; } else { - alias = alias + Const.SLASH_STAR; + pattern = pattern + Const.SLASH_STAR; } } @@ -714,7 +714,7 @@ public class HttpServiceRuntimeImpl String fullAlias = getFullAlias(alias, factory); HttpServiceObjectRegistration existing = legacyMappings.get(fullAlias); if (existing != null) { - throw new PatternInUseException(originalAlias); + throw new PatternInUseException(alias); } String servletName = servlet.getClass().getName(); if ((initparams != null) && (initparams.get(Const.SERVLET_NAME) != null)) { @@ -723,7 +723,7 @@ public class HttpServiceRuntimeImpl Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_TARGET, targetFilter); - props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, alias); + props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, pattern); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, servletName); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT, factory.getFilter()); props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE); |