File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -420,8 +420,11 @@ export class Verifier {
420
420
) : Promise < AuthorizationResponseMessage > {
421
421
const msg = await this . packageManager . unpack ( byteEncoder . encode ( tokenStr ) ) ;
422
422
423
- if ( request . body . accept ?. length && ! request . body . accept . includes ( msg . unpackedMediaType ) ) {
424
- throw new Error ( 'response media type is not accepted by request' ) ;
423
+ if ( request . body . accept ?. length ) {
424
+ const acceptedMediaTypes = request . body . accept . map ( accept => parseAcceptProfile ( accept ) . env ) ;
425
+ if ( ! acceptedMediaTypes . includes ( msg . unpackedMediaType ) ) {
426
+ throw new Error ( 'response media type is not accepted by request' ) ;
427
+ }
425
428
}
426
429
427
430
const response = msg . unpackedMessage as AuthorizationResponseMessage ;
You can’t perform that action at this time.
0 commit comments