This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new df2241c594 Only explicitly return the stylesheet in WadlGenerator and
not other URLs (#1749)
df2241c594 is described below
commit df2241c59481a57aebb1c0693b778a35baaf5570
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Fri Mar 15 15:23:43 2024 +0000
Only explicitly return the stylesheet in WadlGenerator and not other URLs
(#1749)
---
.../java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git
a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
index 16c13400a4..897a2ffbb1 100644
---
a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
+++
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
@@ -243,9 +243,17 @@ public class WadlGenerator implements
ContainerRequestFilter {
if (path.startsWith("/") && !path.isEmpty()) {
path = path.substring(1);
}
- if (stylesheetReference != null && path.endsWith(".xsl")
- || docLocationMap.containsKey(path)) {
+
+ if (docLocationMap.containsKey(path)) {
context.abortWith(getExistingResource(m, ui, path));
+ } else if (stylesheetReference != null) {
+ String theStylesheetReference = stylesheetReference;
+ if (theStylesheetReference.startsWith("/")) {
+ theStylesheetReference =
theStylesheetReference.substring(1);
+ }
+ if (path.endsWith(theStylesheetReference)) {
+ context.abortWith(getExistingResource(m, ui,
stylesheetReference));
+ }
}
}
return;