Skip to content

500 response from env endpoint when supplied pattern is invalid#49942

Merged
snicoll merged 2 commits intospring-projects:3.5.xfrom
dlwldnjs1009:fix/env-endpoint-invalid-pattern
Apr 7, 2026
Merged

500 response from env endpoint when supplied pattern is invalid#49942
snicoll merged 2 commits intospring-projects:3.5.xfrom
dlwldnjs1009:fix/env-endpoint-invalid-pattern

Conversation

@dlwldnjs1009
Copy link
Copy Markdown
Contributor

@dlwldnjs1009 dlwldnjs1009 commented Apr 7, 2026

EnvironmentEndpoint passes the user-supplied pattern directly to
Pattern.compile(...). An invalid regex throws PatternSyntaxException
which is not handled by the actuator web layer, resulting in a 500
response instead of 400.

Wrap PatternSyntaxException in InvalidEndpointRequestException so
that the standard actuator bad-request path is used.

Closes gh-49884

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 7, 2026
@snicoll snicoll self-assigned this Apr 7, 2026
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 7, 2026
@snicoll snicoll added this to the 3.5.14 milestone Apr 7, 2026
@snicoll snicoll changed the base branch from main to 3.5.x April 7, 2026 15:30
@snicoll snicoll changed the title Handle invalid regex pattern in EnvironmentEndpoint 500 response from env endpoint when supplied pattern is invalid Apr 7, 2026
@snicoll snicoll force-pushed the fix/env-endpoint-invalid-pattern branch from 7c2474f to 2181ce0 Compare April 7, 2026 15:30
@snicoll snicoll merged commit a35de55 into spring-projects:3.5.x Apr 7, 2026
3 of 4 checks passed
@dlwldnjs1009 dlwldnjs1009 deleted the fix/env-endpoint-invalid-pattern branch April 8, 2026 00:32
snicoll added a commit that referenced this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 response from env endpoint when supplied pattern is invalid

3 participants