1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

Adapt isAjax to support mimetype lists

Fixes #988
This commit is contained in:
Nikolai Prokoschenko
2021-01-12 16:40:14 +01:00
committed by Nikolai Prokoschenko
parent dd60fe4fef
commit 81bf1ef8ce
3 changed files with 19 additions and 3 deletions

View File

@ -1970,6 +1970,13 @@ func TestAjaxUnauthorizedRequest2(t *testing.T) {
testAjaxUnauthorizedRequest(t, header)
}
func TestAjaxUnauthorizedRequestAccept1(t *testing.T) {
header := make(http.Header)
header.Add("Accept", "application/json, text/plain, */*")
testAjaxUnauthorizedRequest(t, header)
}
func TestAjaxForbiddendRequest(t *testing.T) {
test, err := newAjaxRequestTest()
if err != nil {