Skip to content

Commit

Permalink
Fixes issue with block response handling
Browse files Browse the repository at this point in the history
Overwrite expires header when changing a response to a block response.
  • Loading branch information
TechnikEmpire committed Nov 10, 2017
1 parent 8afd420 commit 1c6ae7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CitadelCore/CitadelCore/CitadelCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<PackageIconUrl />
<RepositoryUrl>https://github.com/TechnikEmpire/CitadelCore</RepositoryUrl>
<PackageTags>proxy filtering content-filtering transparent-proxy</PackageTags>
<PackageReleaseNotes>Fixes issues with classification and next action directives regarding http responses.</PackageReleaseNotes>
<PackageReleaseNotes>Fixes issue with block response handling.</PackageReleaseNotes>
<Description>Transparent filtering HTTP/S and Websocket/WebsocketSecure proxy.</Description>
<Version>1.2.13</Version>
<AssemblyVersion>1.2.13.0</AssemblyVersion>
<FileVersion>1.2.13.0</FileVersion>
<Version>1.2.14</Version>
<AssemblyVersion>1.2.14.0</AssemblyVersion>
<FileVersion>1.2.14.0</FileVersion>
</PropertyGroup>

<ItemGroup Label="dotnet pack instructions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ public override async Task Handle(HttpContext context)
private void Do204(HttpContext context)
{
context.Response.StatusCode = 204;
context.Response.Headers.Remove("Expires");
context.Response.Headers.Add("Expires", new Microsoft.Extensions.Primitives.StringValues(s_EpochHttpDateTime));
return;
}
Expand All @@ -414,7 +415,8 @@ private async Task DoCustomResponse(HttpContext context, string contentType, byt
{
ms.Position = 0;
context.Response.StatusCode = 200;
context.Response.Headers.Add("Expires", new Microsoft.Extensions.Primitives.StringValues(s_EpochHttpDateTime));
context.Response.Headers.Remove("Expires");
context.Response.Headers.Add("Expires", new Microsoft.Extensions.Primitives.StringValues(s_EpochHttpDateTime));
context.Response.ContentType = contentType;
await ms.CopyToAsync(context.Response.Body, 81920, context.RequestAborted);
return;
Expand Down

0 comments on commit 1c6ae7e

Please sign in to comment.