Skip to content

Swagger page returns 404 but loads anyway #1687

@DanielTOsborne

Description

@DanielTOsborne

Describe the bug
The swagger page returns status code 404 on refresh, but still loads contents. This breaks reverse proxies.

Expected behavior
Page status code should not be 404

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to a CDA instance that's using vite/react, such as https://cwms-data.usace.army.mil/cwms-data
  2. Open Developer console, go to Network tab
  3. Click on API Docs -> Swagger UI
  4. Notice page loads fine (aside from possible CORS issues.
  5. Refresh the page (F5)
  6. Notice the /swagger-ui page in the network tab reports 404
  7. Page contents load normally.

Note: It also happens if you directly paste the swagger URL (https://cwms-data.usace.army.mil/cwms-data/swagger-ui) into the address bar, but it's more difficult to see due to needing the developer console.

CDA Version (please complete the following information):
At the top of any instance of CDA you will see a version. Please provide that version.

  • Version 2026.03.16

Additional context
When CDA is behind a reverse proxy, the proxy detects the 404 and returns a standard error page, instead of the supplied contents. So it just says "Document not found."

Image Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions