Skip to content

Commit 19c603d

Browse files
authored
Merge pull request #1584 from Soreepeong/fix/http-req-size
Limit http header size on repairs
2 parents 8c8e8f0 + 3aa4b1f commit 19c603d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/XIVLauncher.Common/Patching/IndexedZiPatch/IndexedZiPatchInstaller.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,11 @@ public HttpInstallTaskConfig(IndexedZiPatchInstaller installer, int sourceIndex,
534534
}
535535

536536
using HttpRequestMessage req = new(HttpMethod.Get, SourceUrl);
537-
req.Headers.Range = new()
538-
{
539-
Unit = "bytes"
540-
};
541-
foreach (var (rangeFrom, rangeToExclusive) in offsets)
537+
req.Headers.Range = new() { Unit = "bytes" };
538+
foreach (var (rangeFrom, rangeToExclusive) in offsets.Take(400))
542539
req.Headers.Range.Ranges.Add(new(rangeFrom, rangeToExclusive + 1));
540+
// "1000000000-1000000000,": 22 bytes; 22x400=8800 bytes in HTTP header should be fine?
541+
543542
if (this.sid != null)
544543
req.Headers.Add("X-Patch-Unique-Id", this.sid);
545544
req.Headers.Add("User-Agent", Constants.PatcherUserAgent);

0 commit comments

Comments
 (0)