We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0fb5ac commit 1f1cf8bCopy full SHA for 1f1cf8b
src/NerdBank.GitVersioning/ManagedGit/ZLibStream.cs
@@ -5,6 +5,7 @@
5
using System.Buffers;
6
using System.IO;
7
using System.IO.Compression;
8
+using System.Linq;
9
using System.Threading;
10
using System.Threading.Tasks;
11
@@ -56,9 +57,9 @@ public ZLibStream(Stream stream, long length = -1)
56
57
Span<byte> zlibHeader = stackalloc byte[2];
58
stream.ReadAll(zlibHeader);
59
- if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C))
60
+ if (zlibHeader[0] != 0x78 || (zlibHeader[1] != 0x01 && zlibHeader[1] != 0x9C && zlibHeader[1] != 0x5E && zlibHeader[1] != 0xDA))
61
{
- throw new GitException();
62
+ throw new GitException($"Invalid zlib header {string.Join(" ", zlibHeader.ToArray().Select(b => $"{b:X2}"))}");
63
}
64
65
0 commit comments