Skip to content

fix: Return 4xx for admin validation failures - #31

Merged
ktrubilo9 merged 2 commits into
ktrubilo9:mainfrom
VedantMadane:fix/issue-22
Aug 26, 2026
Merged

ktrubilo9 merged 2 commits into
ktrubilo9:mainfrom
VedantMadane:fix/issue-22

Conversation

@VedantMadane

Copy link
Copy Markdown
Contributor

Summary

Return 4xx for admin validation failures

Changes

  • internal/admin/handler/backends.go: return 400 when admin op reports !Success
  • internal/admin/handler/virtual_hosts.go: return 400 when admin op reports !Success
  • internal/admin/handler/config.go: return 400 when admin op reports !Success
  • helpers: clientErrorStatus for admin validation failures

Fixes #22

- internal/admin/handler/backends.go: return 400 when admin op reports !Success
- internal/admin/handler/virtual_hosts.go: return 400 when admin op reports !Success
- internal/admin/handler/config.go: return 400 when admin op reports !Success
- helpers: clientErrorStatus for admin validation failures

Fixes #22

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Missing strings import in this file. clientErrorStatus uses strings.ToLower and strings.Contains, so the package currently fails to compile

CI failed on gofmt -l. Also add missing strings import used by
clientErrorStatus so the package compiles after format cleanup.

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@ktrubilo9
ktrubilo9 merged commit 1d1d5e1 into ktrubilo9:main Aug 26, 2026
1 check passed
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.

2 participants