File tree Expand file tree Collapse file tree
src/Sources/NeoReports.Sources.Http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,15 +170,17 @@ private static IEnumerable<string> SplitLinkValues(string headerValue)
170170 var inAngle = false ;
171171 var inQuotes = false ;
172172
173- for ( var i = 0 ; i < headerValue . Length ; i ++ )
173+ var i = 0 ;
174+ while ( i < headerValue . Length )
174175 {
175176 char c = headerValue [ i ] ;
176177
177- // A backslash escape is only meaningful inside a quoted-string (RFC 9110 quoted-pair);
178- // skipping the next char there keeps an escaped quote from ending the string early.
178+ // Inside a quoted string a backslash escapes whatever follows it, so both characters are
179+ // stepped over together — otherwise an escaped quote would look like the end of the
180+ // string and every delimiter after it would be read in the wrong state.
179181 if ( inQuotes && c == '\\ ' )
180182 {
181- i ++ ;
183+ i += 2 ;
182184 continue ;
183185 }
184186
@@ -193,6 +195,8 @@ private static IEnumerable<string> SplitLinkValues(string headerValue)
193195 yield return headerValue [ start ..i ] ;
194196 start = i + 1 ;
195197 }
198+
199+ i ++ ;
196200 }
197201
198202 yield return headerValue [ start ..] ;
You can’t perform that action at this time.
0 commit comments