Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Handling empty Content-Encoding header #248

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Core/Requests/ServiceRequestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ protected static Stream GetResponseStream(IEwsHttpWebResponse response, int read

private static Stream WrapStream(Stream responseStream, string contentEncoding)
{
if (string.IsNullOrEmpty(contentEncoding))
{
return responseStream;
}
if (contentEncoding.ToLowerInvariant().Contains("gzip"))
{
return new GZipStream(responseStream, CompressionMode.Decompress);
Expand Down Expand Up @@ -933,4 +937,4 @@ private void ReadXmlDeclaration(EwsServiceXmlReader reader)

#endregion
}
}
}