mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:22:49 +08:00
fix possible IndexOutOfRange
bug (#979)
This commit is contained in:
parent
647a21bb2d
commit
b32850a804
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
var splits = claimResponse.Data.Split(delimiter.ToCharArray());
|
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}"));
|
return new ErrorResponse<string>(new CannotFindClaimError($"Cannot find claim for key: {key}, delimiter: {delimiter}, index: {index}"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user