Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,12 @@ private static bool TryReadDate(string input, ref int current, out DateTimeOffse

// Find the closing '"'
int dateStartIndex = current;
while (current < input.Length)
int quote = input.AsSpan(current).IndexOf('"');
if (quote <= 0) // no quote was found or it was the first character (meaning an empty quoted string)
{
if (input[current] == '"')
{
break;
}
current++;
}

if ((current == input.Length) || (current == dateStartIndex))
{
return false; // we couldn't find the closing '"' or we have an empty quoted string.
return false;
}
current += quote;

DateTimeOffset temp;
if (!HttpDateParser.TryParse(input.AsSpan(dateStartIndex, current - dateStartIndex), out temp))
Expand Down