Skip to content

Commit 378afe1

Browse files
committed
Only explicitly return the stylesheet in WadlGenerator and not other URLs (#1749)
(cherry picked from commit df2241c)
1 parent 7ae4b00 commit 378afe1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,17 @@ protected void doFilter(ContainerRequestContext context, Message m) {
242242
if (path.startsWith("/") && !path.isEmpty()) {
243243
path = path.substring(1);
244244
}
245-
if (stylesheetReference != null && path.endsWith(".xsl")
246-
|| docLocationMap.containsKey(path)) {
245+
246+
if (docLocationMap.containsKey(path)) {
247247
context.abortWith(getExistingResource(m, ui, path));
248+
} else if (stylesheetReference != null) {
249+
String theStylesheetReference = stylesheetReference;
250+
if (theStylesheetReference.startsWith("/")) {
251+
theStylesheetReference = theStylesheetReference.substring(1);
252+
}
253+
if (path.endsWith(theStylesheetReference)) {
254+
context.abortWith(getExistingResource(m, ui, stylesheetReference));
255+
}
248256
}
249257
}
250258
return;

0 commit comments

Comments
 (0)