mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
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
11 lines
275 B
Go
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{}
|
|
}
|