8000 Accept content-encoding of gzip for remote scripts · dotnet-script/dotnet-script@3bdae3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 3bdae3c

Browse files
committed
Accept content-encoding of gzip for remote scripts
1 parent 7a798a5 commit 3bdae3c

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,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Net;
34
using System.Net.Http;
45
using System.Net.Mime;
56
using System.Threading.Tasks;
@@ -11,7 +12,12 @@ public class ScriptDownloader
1112
public async Task<string> Download(string uri)
1213
{
1314
const string plainTextMediaType = "text/plain";
14-
using (HttpClient client = new HttpClient())
15+
using (HttpClient client = new HttpClient(new HttpClientHandler
16+
{
17+
// Avoid Deflate due to bugs. For more info, see:
18+
// https://github.com/weblinq/WebLinq/issues/132
19+
AutomaticDecompression = DecompressionMethods.GZip
20+
}))
1521
{
1622
using (HttpResponseMessage response = await client.GetAsync(uri))
1723
{

0 commit comments

Comments
 (0)
0