From f3632ec36eb5a500ea233a006092bc40804ea77c Mon Sep 17 00:00:00 2001 From: vishnuborn1996 <33519729+vishnuborn1996@users.noreply.github.com> Date: Wed, 27 Feb 2019 20:54:49 +0530 Subject: [PATCH] Bug_fix There is bug in your code. All the post requests gets blocked. --- HackerSpray.WebModule/HackerSprayWebDefence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HackerSpray.WebModule/HackerSprayWebDefence.cs b/HackerSpray.WebModule/HackerSprayWebDefence.cs index 78c4d29..1e34093 100644 --- a/HackerSpray.WebModule/HackerSprayWebDefence.cs +++ b/HackerSpray.WebModule/HackerSprayWebDefence.cs @@ -53,8 +53,8 @@ public class HackerSprayWebDefence foreach (var path in HackerSprayConfig.Settings.Paths) { - if ((path.Post && context.Request.HttpMethod == "POST") - || (!path.Post && context.Request.HttpMethod == "GET") + if (((path.Post && context.Request.HttpMethod == "POST") + || (!path.Post && context.Request.HttpMethod == "GET")) && path.Name == context.Request.Path) { Hacker.Logger.LogDebug(ClassName + ' ' + "Path matched: " + context.Request.Path);