Skip to content

Commit 4c4f188

Browse files
authored
Merge pull request #569 from atifaziz/accept-encoding-gzip
Accept content-encoding of "gzip" for remote scripts
2 parents 8594f3e + 4f9dbd7 commit 4c4f188

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Dotnet.Script.Core/ScriptDownloader.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.IO.Compression;
4+
using System.Net;
45
using System.Net.Http;
56
using System.Threading.Tasks;
67

@@ -10,7 +11,12 @@ public class ScriptDownloader
1011
{
1112
public async Task<string> Download(string uri)
1213
{
13-
using (HttpClient client = new HttpClient())
14+
using (HttpClient client = new HttpClient(new HttpClientHandler
15+
{
16+
// Avoid Deflate due to bugs. For more info, see:
17+
// https://github.com/weblinq/WebLinq/issues/132
18+
AutomaticDecompression = DecompressionMethods.GZip
19+
}))
1420
{
1521
using (HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead))
1622
{

0 commit comments

Comments
 (0)