core/authorize: result denied improvements (#4952)

* core/authorize: result denied improvements

* add authenticate robots.txt

* fix tests
This commit is contained in:
Caleb Doxsey 2024-02-01 16:16:33 -07:00 committed by GitHub
parent 61a9bd7c6b
commit 55eb2fa3dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 91 deletions

View file

@ -16,20 +16,6 @@ import (
"github.com/pomerium/pomerium/internal/urlutil"
)
func TestProxy_RobotsTxt(t *testing.T) {
proxy := Proxy{}
req := httptest.NewRequest(http.MethodGet, "/robots.txt", nil)
rr := httptest.NewRecorder()
proxy.RobotsTxt(rr, req)
if status := rr.Code; status != http.StatusOK {
t.Errorf("handler returned wrong status code: got %v want %v", status, http.StatusOK)
}
expected := "User-agent: *\nDisallow: /"
if rr.Body.String() != expected {
t.Errorf("handler returned wrong body: got %v want %v", rr.Body.String(), expected)
}
}
func TestProxy_SignOut(t *testing.T) {
t.Parallel()
tests := []struct {