Skip to content

Commit

Permalink
Request renderer: Remove ServerVariable from API in .NET Core
Browse files Browse the repository at this point in the history
Remove nonsupported property from API

Fixes #40, fixes #39
  • Loading branch information
304NotModified committed May 24, 2016
1 parent d03e164 commit 7187b2b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#if !NETSTANDARD_1plus
using NLog.Common;
using System.Web;
using System.Web.Routing;
#else
using Microsoft.AspNetCore.Http;
#endif
Expand Down Expand Up @@ -57,12 +58,18 @@ public class AspNetRequestValueLayoutRenderer : AspNetLayoutRendererBase
/// <docgen category='Rendering Options' order='10' />
public string Cookie { get; set; }

#if !NETSTANDARD_1plus

//missing in .NET Core (RC2)

/// <summary>
/// Gets or sets the ServerVariables item to be rendered.
/// </summary>
/// <docgen category='Rendering Options' order='10' />
public string ServerVariable { get; set; }

#endif

/// <summary>
/// Gets or sets the Headers item to be rendered.
/// </summary>
Expand Down Expand Up @@ -109,15 +116,14 @@ protected override void DoAppend(StringBuilder builder, LogEventInfo logEvent)
#endif

}
#if !NETSTANDARD_1plus
else if (this.ServerVariable != null)
{
#if !NETSTANDARD_1plus

builder.Append(httpRequest.ServerVariables[this.ServerVariable]);
#else

throw new NotSupportedException();
#endif
}
#endif
else if (this.Header != null)
{
string header = httpRequest.Headers[this.Header];
Expand Down

0 comments on commit 7187b2b

Please sign in to comment.