mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-20 07:22:50 +08:00
fix possible IndexOutOfRange
bug (#979)
This commit is contained in:
parent
647a21bb2d
commit
b32850a804
@ -1,6 +1,6 @@
|
||||
namespace Ocelot.Infrastructure.Claims.Parser
|
||||
{
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Responses;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
var splits = claimResponse.Data.Split(delimiter.ToCharArray());
|
||||
|
||||
if (splits.Length < index || index < 0)
|
||||
if (splits.Length <= index || index < 0)
|
||||
{
|
||||
return new ErrorResponse<string>(new CannotFindClaimError($"Cannot find claim for key: {key}, delimiter: {delimiter}, index: {index}"));
|
||||
}
|
||||
@ -55,4 +55,4 @@
|
||||
return new ErrorResponse<string>(new CannotFindClaimError($"Cannot find claim for key: {key}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user