Display Name
Display Name

Reputation: 15111

How to block requests based on country region?

I want to block any request from some country regions.

How to do this in asp.net mvc?

Upvotes: 1

Views: 1603

Answers (2)

Gup3rSuR4c
Gup3rSuR4c

Reputation: 9490

I'd recommend the MaxMind GeoCountry database, which is also the accepted answer for the post @Cybernate recommended. I personally use the paid Region database and am quite satisfied with it.

I'm not sure about going the route of an HttpModule however. I personally feel better with an ActionFilterAttribute which overrides the OnActionExecuting method.

Upvotes: 0

Chandu
Chandu

Reputation: 82933

You can define a HttpModule and then identify the origin of incoming request using one of the methods defined in this SO post to filter the requests

Upvotes: 2

Related Questions