fix: return 200 for CDA GUI client routes - #1871
Open
krowvin wants to merge 1 commit into
Open
Conversation
Signed-off-by: Charles Graham, SWT <[email protected]>
krowvin
marked this pull request as ready for review
August 8, 2026 01:34
MikeNeilson
requested changes
Aug 10, 2026
| /** | ||
| * Converts the error dispatch used to load known client-side routes into a successful response. | ||
| */ | ||
| public final class SpaErrorStatusFilter implements Filter { |
Contributor
There was a problem hiding this comment.
Add @WebFilter (I think, look at the other filters for the right annotation) and remove the web.xml change.
Unless there's a specific reason to configure it in the web.xml instead. That recommendation is likely left over from all the examples that existed before annotations were supported in Java.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had been sitting on this branch for a minute and thought I would go ahead and PR it.
See Daniel's reported issue for details
Infra was setup i believe to support having CDA's UI and API being split.
instead of
https://cwms-data.usace.army.mil/cwms-data being the UI and API
https://cwms-data.usace.army.mil -> UI
https://cwms-data.usace.army.mil/cwms-dat -> API
Summary
Root Cause
Tomcat routes missing static resources through the
404error-page mapping toindex.html. The React app therefore renders successfully, but the original 404 status remains on the response. Reverse proxies and web crawlers treat that successful page as missing.The new error-dispatch filter changes the status only for known GUI
GETandHEADroutes. API and unknown-route 404 behavior is left intact.Related Issue
Closes #1687
Validation
./gradlew :cwms-data-api:test --tests 'cwms.cda.servlet.SpaErrorStatusFilterTest'— 13 passed./gradlew :cwms-data-api:checkstyleMain :cwms-data-api:checkstyleTest :cwms-data-api:test --tests 'cwms.cda.servlet.SpaErrorStatusFilterTest'— passed; the new files have no Checkstyle findings./gradlew build— compilation, GUI build, WAR packaging, and 745 tests passed; the test task failed on 9 existing Mockito failures under local JDK 21 while mocking generated/final classesChecklist