mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-26 21:19:31 +02:00
22 lines
498 B
Go
22 lines
498 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestJWKSHandler(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
t.Run("cors", func(t *testing.T) {
|
|
w := httptest.NewRecorder()
|
|
r := httptest.NewRequest(http.MethodOptions, "/", nil)
|
|
r.Header.Set("Origin", "https://www.example.com")
|
|
r.Header.Set("Access-Control-Request-Method", "GET")
|
|
JWKSHandler("").ServeHTTP(w, r)
|
|
assert.Equal(t, http.StatusNoContent, w.Result().StatusCode)
|
|
})
|
|
}
|