Skip to content

refactor(auth): extract rejectNotProxied helper in requireProxy#118

Closed
I-am-nothing wants to merge 1 commit into
mainfrom
simplify/pr117-proxy-guard
Closed

refactor(auth): extract rejectNotProxied helper in requireProxy#118
I-am-nothing wants to merge 1 commit into
mainfrom
simplify/pr117-proxy-guard

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

Summary

  • Both failure paths in requireProxy (unreadable token source and token mismatch) wrote an identical httputil.JSON 403/not_proxied response inline — duplicated across 8 lines
  • Extract rejectNotProxied(w) so the response body is defined once; the distinct log.Printf calls before each site are preserved for per-path diagnostics
  • No behavioral change; go test ./auth/... ./internal/core/... green

/simplify pass on PR #117 (feat/require-proxy-token).

🤖 Generated with Claude Code

Both failure paths in requireProxy (unreadable token source and token
mismatch) wrote the same httputil.JSON 403/not_proxied response inline.
Extract rejectNotProxied() so the response body is defined once;
the distinct log.Printf calls before each site are preserved for
per-path diagnostics.

No behavior change. go test ./auth/... ./internal/core/... green.
@I-am-nothing

Copy link
Copy Markdown
Contributor Author

Folded into #119 (the rejectNotProxied dedup is included there).

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.

1 participant