Skip to content

Commit

Permalink
Closes #179
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Offen committed Aug 21, 2017
1 parent b8ad211 commit 72e50a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Grapevine/Interfaces/Server/HttpResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ public interface IHttpResponse

public class HttpResponse : IHttpResponse
{
private static string _server;

static HttpResponse()
{
var assembly = AppDomain.CurrentDomain.GetAssemblies().SingleOrDefault(a => a.GetName().Name == "Grapevine");
if (assembly != null) _server = $"{assembly.GetName().Name}/{assembly.GetName().Version}";
}

private ContentType _contentType;
private bool _parsedContentType;

Expand Down Expand Up @@ -282,6 +290,8 @@ public void SetCookie(Cookie cookie)

public void SendResponse(byte[] contents)
{
if (_server != null) Headers["Server"] = _server;

if (RequestHeaders.AllKeys.Contains("Accept-Encoding") && RequestHeaders["Accept-Encoding"].Contains("gzip") && contents.Length > 1024)
{
using (var ms = new MemoryStream())
Expand Down

0 comments on commit 72e50a9

Please sign in to comment.