Commit af09eb02 authored by Kent Friesen's avatar Kent Friesen

Adds brotli compression support to the proxy.

parent bf983616
...@@ -18,6 +18,8 @@ namespace Titanium.Web.Proxy.Compression ...@@ -18,6 +18,8 @@ namespace Titanium.Web.Proxy.Compression
return new GZipStream(stream, CompressionMode.Decompress, leaveOpen); return new GZipStream(stream, CompressionMode.Decompress, leaveOpen);
case KnownHeaders.ContentEncodingDeflate: case KnownHeaders.ContentEncodingDeflate:
return new DeflateStream(stream, CompressionMode.Decompress, leaveOpen); return new DeflateStream(stream, CompressionMode.Decompress, leaveOpen);
case KnownHeaders.ContentEncodingBrotli:
return new BrotliSharpLib.BrotliStream(stream, CompressionMode.Decompress, leaveOpen);
default: default:
throw new Exception($"Unsupported decompression mode: {type}"); throw new Exception($"Unsupported decompression mode: {type}");
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
public const string ContentEncoding = "content-encoding"; public const string ContentEncoding = "content-encoding";
public const string ContentEncodingDeflate = "deflate"; public const string ContentEncodingDeflate = "deflate";
public const string ContentEncodingGzip = "gzip"; public const string ContentEncodingGzip = "gzip";
public const string ContentEncodingBrotli = "br";
public const string Location = "Location"; public const string Location = "Location";
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BrotliSharpLib" Version="0.3.1" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.2" /> <PackageReference Include="Portable.BouncyCastle" Version="1.8.2" />
<PackageReference Include="StreamExtended" Version="1.0.179" /> <PackageReference Include="StreamExtended" Version="1.0.179" />
</ItemGroup> </ItemGroup>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<dependencies> <dependencies>
<dependency id="StreamExtended" version="1.0.179" /> <dependency id="StreamExtended" version="1.0.179" />
<dependency id="Portable.BouncyCastle" version="1.8.2" /> <dependency id="Portable.BouncyCastle" version="1.8.2" />
<dependency id="BrotliSharpLib" version="0.3.1" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment