Created
July 5, 2011 06:25
-
-
Save jeff-french/1064343 to your computer and use it in GitHub Desktop.
[BLOG] Gist+AppHarbor=Sad Face :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web; | |
using Glimpse.Core.Configuration; | |
using Glimpse.Core.Extensibility; | |
namespace Glimpse.Core.Validator | |
{ | |
[GlimpseValidator] | |
internal class IpAddressValidator:IGlimpseValidator{ | |
public bool IsValid(HttpContextBase context, GlimpseConfiguration configuration, LifecycleEvent lifecycleEvent) | |
{ | |
if (configuration.IpAddresses.Count == 0) return true; //no configured list, allow all IP's | |
return configuration.IpAddresses.Contains(context.Request.UserHostAddress); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment