Skip to content

Commit

Permalink
Fixes #201, removes unused using statements
Browse files Browse the repository at this point in the history
  • Loading branch information
scottoffen committed Jan 1, 2021
1 parent 0475f93 commit a94ea8d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 76 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TestResult.xml

# Visual Studio 2015 cache/options directory
.vs/
.vscode/

#SonarQube
.sonarqube/
Expand Down
28 changes: 1 addition & 27 deletions src/Grapevine.Tests/Server/AdvancedRestServerFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void AuthenticationSchemeSelectorDelegateProperty()
{
var listener = Substitute.For<IHttpListener>();
var advanced = new AdvancedRestServer(listener);

var val = advanced.AuthenticationSchemeSelectorDelegate;
advanced.AuthenticationSchemeSelectorDelegate = val;

Expand All @@ -35,32 +35,6 @@ public void AuthenticationSchemesProperty()
listener.Received().AuthenticationSchemes = val;
}

//[Fact]
//public void ExtendedProtectionPolicyProperty()
//{
// var listener = Substitute.For<IHttpListener>();
// var advanced = new AdvancedRestServer(listener);

// var val = advanced.ExtendedProtectionPolicy;
// advanced.ExtendedProtectionPolicy = val;

// var temp = listener.Received().ExtendedProtectionPolicy;
// listener.Received().ExtendedProtectionPolicy = val;
//}

//[Fact]
//public void ExtendedProtectionSelectorDelegateProperty()
//{
// var listener = Substitute.For<IHttpListener>();
// var advanced = new AdvancedRestServer(listener);

// var val = advanced.ExtendedProtectionSelectorDelegate;
// advanced.ExtendedProtectionSelectorDelegate = val;

// var temp = listener.Received().ExtendedProtectionSelectorDelegate;
// listener.Received().ExtendedProtectionSelectorDelegate = val;
//}

[Fact]
public void IgnoreWriteExceptionsProperty()
{
Expand Down
28 changes: 0 additions & 28 deletions src/Grapevine/Interfaces/Server/IHttpListener.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Net;
using System.Security.Authentication.ExtendedProtection;
using System.Security.Permissions;

namespace Grapevine.Interfaces.Server
Expand All @@ -20,21 +19,11 @@ public interface IHttpListener : IDisposable
/// </summary>
AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate { get; set; }

/// <summary>
/// Gets a default list of Service Provider Names (SPNs) as determined by registered prefixes.
/// </summary>
ServiceNameCollection DefaultServiceNames { get; }

/// <summary>
/// Get or set the ExtendedProtectionPolicy to use for extended protection for a session.
/// </summary>
//ExtendedProtectionPolicy ExtendedProtectionPolicy { get; set; }

/// <summary>
/// Get or set the delegate called to determine the ExtendedProtectionPolicy to use for each request.
/// </summary>
//System.Net.HttpListener.ExtendedProtectionSelector ExtendedProtectionSelectorDelegate { get; set; }

/// <summary>
/// Gets or sets a Boolean value that specifies whether your application receives exceptions that occur when an HttpListener sends the response to the client.
/// </summary>
Expand Down Expand Up @@ -132,23 +121,6 @@ public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate
set { InnerListener.AuthenticationSchemeSelectorDelegate = value; }
}

public ServiceNameCollection DefaultServiceNames => InnerListener.DefaultServiceNames;

//public ExtendedProtectionPolicy ExtendedProtectionPolicy
//{
// get { return InnerListener.ExtendedProtectionPolicy; }
// set
// {
// InnerListener.ExtendedProtectionPolicy = value;
// }
//}

//public System.Net.HttpListener.ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
//{
// get { return InnerListener.ExtendedProtectionSelectorDelegate; }
// set { InnerListener.ExtendedProtectionSelectorDelegate = value; }
//}

public bool IgnoreWriteExceptions
{
get { return InnerListener.IgnoreWriteExceptions; }
Expand Down
20 changes: 0 additions & 20 deletions src/Grapevine/Server/RestServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Authentication.ExtendedProtection;
using System.Threading;
using Grapevine.Exceptions.Server;
using Grapevine.Interfaces.Server;
using Grapevine.Interfaces.Shared;
using Grapevine.Shared;
using Grapevine.Shared.Loggers;
using ExtendedProtectionSelector = System.Net.HttpListener.ExtendedProtectionSelector;
using HttpListener = Grapevine.Interfaces.Server.HttpListener;

namespace Grapevine.Server
Expand Down Expand Up @@ -424,24 +422,6 @@ public AuthenticationSchemes AuthenticationSchemes
set { _listener.AuthenticationSchemes = value; }
}

/// <summary>
/// Get or set the ExtendedProtectionPolicy to use for extended protection for a session
/// </summary>
//public ExtendedProtectionPolicy ExtendedProtectionPolicy
//{
// get { return _listener.ExtendedProtectionPolicy; }
// set { _listener.ExtendedProtectionPolicy = value; }
//}

/// <summary>
/// Get or set the delegate called to determine the ExtendedProtectionPolicy to use for each request
/// </summary>
//public ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
//{
// get { return _listener.ExtendedProtectionSelectorDelegate; }
// set { _listener.ExtendedProtectionSelectorDelegate = value; }
//}

/// <summary>
/// Gets or sets a Boolean value that specifies whether your application receives exceptions that occur when an HttpListener sends the response to the client
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/Grapevine/Server/Router.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand Down

0 comments on commit a94ea8d

Please sign in to comment.