We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1719f7 commit 2aa56adCopy full SHA for 2aa56ad
1 file changed
nanoFramework.System.Net.Http/Http/System.Net.WebHeaders.cs
@@ -427,7 +427,16 @@ public void Add(string header)
427
}
428
429
string name = header.Substring(0, colpos);
430
- string value = header.Substring(colpos + 1);
+ // Fix: Check bounds before Substring to prevent ArgumentOutOfRangeException
431
+ string value;
432
+ if (colpos + 1 >= header.Length)
433
+ {
434
+ value = string.Empty;
435
+ }
436
+ else
437
438
+ value = header.Substring(colpos + 1);
439
440
441
name = CheckBadChars(name, false);
442
ThrowOnRestrictedHeader(name);
0 commit comments