Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4c4f188

Browse filesBrowse 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
Copy full SHA for 4c4f188

File tree

1 file changed

+7
-1
lines changed
Filter options

1 file changed

+7
-1
lines changed

‎src/Dotnet.Script.Core/ScriptDownloader.cs

Copy file name to clipboardExpand all lines: src/Dotnet.Script.Core/ScriptDownloader.cs
+7-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.