Skip to content

fix: restore localhost-only server defaults#151

Merged
jingxiang-z merged 1 commit intomainfrom
fix/helm-localhost-cors
Mar 31, 2026
Merged

fix: restore localhost-only server defaults#151
jingxiang-z merged 1 commit intomainfrom
fix/helm-localhost-cors

Conversation

@jingxiang-z
Copy link
Copy Markdown
Collaborator

@jingxiang-z jingxiang-z commented Mar 31, 2026

Description

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • Configuration

    • Agent network binding changed to listen on localhost (127.0.0.1:15133) instead of all network interfaces.
  • Refactor

    • Removed CORS header handling from server middleware.

Signed-off-by: Jingxiang Zhang <jingzhang@nvidia.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

The pull request removes custom CORS middleware from the server's request handling, eliminating explicit Access-Control-Allow-* header management and OPTIONS request short-circuiting. Corresponding test assertions are updated to reflect the absence of CORS headers. Additionally, the Helm chart restricts the agent's network binding from all interfaces to loopback only.

Changes

Cohort / File(s) Summary
CORS Middleware Removal
internal/server/server.go, internal/server/handlers_test.go
Removed custom CORS middleware that set Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers headers, and handled OPTIONS preflight requests with 204 responses. Test expectations updated to reflect empty CORS headers and 404 response for OPTIONS requests instead of 204.
Network Binding Configuration
deployments/helm/fleet-intelligence-agent/values.yaml
Updated listenAddress from 0.0.0.0:15133 (all interfaces) to 127.0.0.1:15133 (loopback only), restricting agent network access to localhost.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Whiskers twitching with delight,
CORS headers fade from sight,
Localhost walls keep us tight,
Security shines ever bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: restore localhost-only server defaults' directly aligns with the main changes: updating listenAddress to 127.0.0.1 (localhost) and removing CORS middleware that previously allowed all origins.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/helm-localhost-cors

Comment @coderabbitai help to get the list of available commands and usage tips.

@jingxiang-z jingxiang-z requested a review from rsampaio March 31, 2026 20:59
@jingxiang-z jingxiang-z self-assigned this Mar 31, 2026
@jingxiang-z jingxiang-z merged commit cd41477 into main Mar 31, 2026
9 checks passed
@jingxiang-z jingxiang-z deleted the fix/helm-localhost-cors branch March 31, 2026 21:35
jingxiang-z added a commit that referenced this pull request Apr 14, 2026
Signed-off-by: Jingxiang Zhang <jingzhang@nvidia.com>
jingxiang-z added a commit that referenced this pull request Apr 14, 2026
Signed-off-by: Jingxiang Zhang <jingzhang@nvidia.com>
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