Files
Pulse/internal/api/export_test.go
rcourtman e248f2b895 fix: Update TestPublicURLDetectionUsesForwardedHeaders for proxy hardening
The test was failing after commit d6cbfc23 added security hardening
that requires authentication and trusted proxy configuration for
X-Forwarded-* headers to be read during public URL detection.

- Add API token authentication to the test request
- Configure 127.0.0.1 as trusted proxy for the test
- Add export_test.go with ResetTrustedProxyConfigForTests() to allow
  external tests to reset the trusted proxy configuration
2025-12-02 03:16:52 +00:00

11 lines
275 B
Go

package api
import "sync"
// ResetTrustedProxyConfigForTests resets the trusted proxy configuration.
// This must be called after setting PULSE_TRUSTED_PROXY_CIDRS env var.
func ResetTrustedProxyConfigForTests() {
trustedProxyCIDRs = nil
trustedProxyOnce = sync.Once{}
}