mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
fix test
This commit is contained in:
parent
a546ee1a80
commit
27c0b5f3c4
1 changed files with 3 additions and 2 deletions
|
@ -182,13 +182,14 @@ func TestProxy_jwt(t *testing.T) {
|
|||
}
|
||||
|
||||
// with upstream request headers being set
|
||||
rawJWT := "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTY3MDg4OTI0MSwiZXhwIjoxNjcwODkyODQxfQ.YoROB12_-a8VxikPqrYOA576pLYoLFeGwXAOWCGpXgM"
|
||||
req, _ = http.NewRequest("GET", "https://www.example.com/.pomerium/jwt", nil)
|
||||
w = httptest.NewRecorder()
|
||||
req.Header.Set(httputil.HeaderPomeriumJWTAssertion, "MOCK_JWT")
|
||||
req.Header.Set(httputil.HeaderPomeriumJWTAssertion, rawJWT)
|
||||
err = proxy.jwtAssertion(w, req)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
assert.Equal(t, "application/jwt", w.Header().Get("Content-Type"))
|
||||
assert.Equal(t, w.Body.String(), "MOCK_JWT")
|
||||
assert.Equal(t, w.Body.String(), rawJWT)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue