Skip to content

Commit df2241c

Browse files
authored
Only explicitly return the stylesheet in WadlGenerator and not other URLs (#1749)
1 parent bc28b0c commit df2241c

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
@@ -243,9 +243,17 @@ protected void doFilter(ContainerRequestContext context, Message m) {
243243
if (path.startsWith("/") && !path.isEmpty()) {
244244
path = path.substring(1);
245245
}
246-
if (stylesheetReference != null && path.endsWith(".xsl")
247-
|| docLocationMap.containsKey(path)) {
246+
247+
if (docLocationMap.containsKey(path)) {
248248
context.abortWith(getExistingResource(m, ui, path));
249+
} else if (stylesheetReference != null) {
250+
String theStylesheetReference = stylesheetReference;
251+
if (theStylesheetReference.startsWith("/")) {
252+
theStylesheetReference = theStylesheetReference.substring(1);
253+
}
254+
if (path.endsWith(theStylesheetReference)) {
255+
context.abortWith(getExistingResource(m, ui, stylesheetReference));
256+
}
249257
}
250258
}
251259
return;

0 commit comments

Comments
 (0)