mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 23:27:43 +02:00
proxy: fix wrong applied middleware
Validate signature middleware must be applied for the callback sub-router, not the whole dashboard router. Fixes #1297
This commit is contained in:
parent
afec38e5cb
commit
31205c0c29
2 changed files with 17 additions and 1 deletions
|
@ -15,6 +15,22 @@ func TestDashboard(t *testing.T) {
|
|||
ctx, clearTimeout := context.WithTimeout(ctx, time.Second*30)
|
||||
defer clearTimeout()
|
||||
|
||||
t.Run("user dashboard", func(t *testing.T) {
|
||||
client := testcluster.NewHTTPClient()
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", "https://httpdetails.localhost.pomerium.io/.pomerium", nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
res, err := client.Do(req)
|
||||
if !assert.NoError(t, err, "unexpected http error") {
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
assert.Equal(t, http.StatusFound, res.StatusCode, "unexpected status code")
|
||||
})
|
||||
t.Run("image asset", func(t *testing.T) {
|
||||
client := testcluster.NewHTTPClient()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue