Skip to content

Conversation

@dennisoelkers
Copy link
Member

Description

Motivation and Context

This PR changes the default catch-all method which is supposed to return the frontend bootstrapping HTML for deep-links to check if the missing URL is an API endpoint and return a 404 instead.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@@ -0,0 +1,4 @@
type = "f"
message = "Return 404 instead of HTML for missing API methods."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would find "instead of HTML for a non existing API endpoint" more clear?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Path("{filename:.*}")
public Response getIndex(@Context ContainerRequest request,
@Context HttpHeaders headers) {
if (request.getAbsolutePath().getPath().startsWith("/api")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment on the purpose here, too. and not only rely on the changelog for explanation. Also, would it make sense to add /api as a constant to be re-used? (although it might be unlikely that we ever change that path)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janheise janheise self-requested a review January 5, 2026 08:58
@janheise janheise self-assigned this Jan 6, 2026
Copy link
Contributor

@janheise janheise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@janheise janheise merged commit 615990f into master Jan 6, 2026
23 checks passed
@janheise janheise deleted the fix/404-for-missing-API-endpoints branch January 6, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants