(t *testing.T)
| 146 | } |
| 147 | |
| 148 | func TestAuthorizeMultipleAuthorizationHeader(t *testing.T) { |
| 149 | t.Parallel() |
| 150 | |
| 151 | for _, testdata := range authTestData { |
| 152 | t.Run(testdata.algorithm, func(t *testing.T) { |
| 153 | t.Parallel() |
| 154 | |
| 155 | if testdata.certificate != "" { |
| 156 | t.SkipNow() |
| 157 | } |
| 158 | |
| 159 | r, _ := http.NewRequest(http.MethodGet, defaultHubURL, nil) |
| 160 | r.Header.Add("Authorization", testdata.validEmpty) |
| 161 | r.Header.Add("Authorization", testdata.validEmpty) |
| 162 | |
| 163 | h := createDummy(t, WithSubscriberJWT([]byte{}, testdata.algorithm)) |
| 164 | |
| 165 | claims, err := h.authorize(r, false) |
| 166 | require.EqualError(t, err, `invalid "Authorization" HTTP header`) |
| 167 | require.Nil(t, claims) |
| 168 | }) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | func TestAuthorizeAuthorizationHeaderTooShort(t *testing.T) { |
| 173 | t.Parallel() |
nothing calls this directly
no test coverage detected