Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3). Masyunis customizations are re-applied in the following commits.
25 lines
576 B
Go
25 lines
576 B
Go
package test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
)
|
|
|
|
func TestIntegrationServerLoadsDefaultPolicy(t *testing.T) {
|
|
server := spawnAnubisWithPolicy(t, "", "", "")
|
|
request, err := http.NewRequest(http.MethodGet, server+"/", nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
request.Header.Set("X-Real-IP", "127.0.0.1")
|
|
request.Header.Set("User-Agent", "Sephiroth")
|
|
response, err := http.DefaultClient.Do(request)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Cleanup(func() { response.Body.Close() })
|
|
if response.StatusCode != http.StatusOK {
|
|
t.Fatalf("status = %d", response.StatusCode)
|
|
}
|
|
}
|