Skip to content

Commit fec3bfe

Browse files
dsilvamclaude
andauthored
fix(rest-api): disable Jersey WADL descriptor endpoint (#34786) (#35498)
## Summary - Disables Jersey's WADL descriptor by setting `ServerProperties.WADL_FEATURE_DISABLE=true` in `DotRestApplication` - `/api/application.wadl` now returns 404 instead of exposing a machine-readable inventory of all REST endpoints without authentication - Enables Maven build cache for faster incremental builds ## Test plan - [ ] Start dotCMS and verify `GET /api/application.wadl` returns 404/405 - [ ] Verify all other `/api/*` endpoints still work normally - [ ] Verify admin panel is unaffected Closes #34786 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f495ee3 commit fec3bfe

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

.claude/commands/gh-issue-troubleshoot.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: gh-issue-troubleshoot
33
description: Fix a dotCMS GitHub issue end-to-end — fetches the issue, researches the codebase, proposes a concrete code fix with before/after diffs, iterates on developer feedback, then applies the approved fix to a new git branch.
44
argument-hint: <issue-number|issue-url>
5-
allowed-tools: Bash(gh issue view:*), Bash(gh api:*), Bash(gh auth status:*), Bash(gh repo view:*), Bash(git checkout -b:*), Bash(git diff:*), Bash(git log:*), Bash(git blame:*), Bash(./mvnw *), Read, Edit, Write, Grep, Glob, Agent, WebFetch
5+
allowed-tools: Bash(gh issue view:*), Bash(gh api:*), Bash(gh auth status:*), Bash(gh repo view:*), Bash(git checkout -b:*), Bash(git checkout:*), Bash(git pull:*), Bash(git show-ref:*), Bash(git diff:*), Bash(git log:*), Bash(git blame:*), Bash(./mvnw *), Read, Edit, Write, Grep, Glob, Agent, WebFetch
66
---
77

88
**Input:** $ARGUMENTS
@@ -167,22 +167,29 @@ After presenting the proposal:
167167

168168
## Step 6 — Apply the fix
169169

170-
### 6a. Create a branch
170+
### 6a. Pull latest main and create a branch
171+
172+
First, ensure the local `main` branch is up to date:
173+
174+
```
175+
git checkout main
176+
git pull origin main
177+
```
171178

172179
Where `<short-slug>` is 3–5 words from the issue title, lowercased, hyphenated.
173180
Examples:
174-
- "NPE in workflow transitions" → `fix/issue-34901-workflow-npe`
175-
- "Content editor fails to save" → `fix/issue-34902-content-editor-save`
176-
- "REST endpoint returns 500 on missing param" → `fix/issue-34903-rest-missing-param-500`
181+
- "NPE in workflow transitions" → `issue-34901-workflow-npe`
182+
- "Content editor fails to save" → `issue-34902-content-editor-save`
183+
- "REST endpoint returns 500 on missing param" → `issue-34903-rest-missing-param-500`
177184

178185
Check whether the branch already exists before creating it:
179186

180187
```
181-
git show-ref --verify --quiet refs/heads/fix/issue-<N>-<short-slug>
188+
git show-ref --verify --quiet refs/heads/issue-<N>-<short-slug>
182189
```
183190

184-
- If the branch **does not exist**`git checkout -b fix/issue-<N>-<short-slug>`
185-
- If the branch **already exists**`git checkout fix/issue-<N>-<short-slug>` (switch to it and continue applying changes on top)
191+
- If the branch **does not exist**`git checkout -b issue-<N>-<short-slug>`
192+
- If the branch **already exists**`git checkout issue-<N>-<short-slug>` (switch to it and continue applying changes on top)
186193

187194
### 6b. Apply changes
188195

@@ -215,7 +222,7 @@ Print this block:
215222
```
216223
## Fix applied
217224
218-
- **Branch:** fix/issue-<N>-<slug>
225+
- **Branch:** issue-<N>-<slug>
219226
- **Files changed:** <list each file>
220227
- **Tests:** passed / skipped / failed
221228

.mvn/maven-build-cache-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ https://maven.apache.org/extensions/maven-build-cache-extension/maven-build-cach
2828
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2929
xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd">
3030
<configuration>
31-
<enabled>false</enabled>
31+
<enabled>true</enabled>
3232
<hashAlgorithm>SHA-256</hashAlgorithm>
3333
<validateXml>true</validateXml>
3434
<local>

dotCMS/src/main/java/com/dotcms/rest/config/DotRestApplication.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import javax.ws.rs.ApplicationPath;
2121
import org.glassfish.jersey.media.multipart.MultiPartFeature;
2222
import org.glassfish.jersey.server.ResourceConfig;
23+
import org.glassfish.jersey.server.ServerProperties;
2324

2425
/**
2526
* This class provides the list of all the REST end-points in dotCMS. Every new
@@ -149,7 +150,8 @@ private void configureApplication() {
149150
packages.add(TelemetryResource.class.getPackageName());
150151
}
151152

152-
register(MultiPartFeature.class)
153+
property(ServerProperties.WADL_FEATURE_DISABLE, true)
154+
.register(MultiPartFeature.class)
153155
.register(JacksonJaxbJsonProvider.class)
154156
.registerClasses(customClasses.keySet())
155157
.packages(packages.toArray(new String[0])

0 commit comments

Comments
 (0)