Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
easyextensionsaspnetcore HttpRequestExtensions
BigMakCode edited this page Aug 5, 2024
·
1 revision
HttpRequest extensions.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph EasyExtensions.AspNetCore
EasyExtensions.AspNetCore.HttpRequestExtensions[[HttpRequestExtensions]]
end
| Returns | Name |
|---|---|
string | GetRemoteAddress(HttpRequest request)Get remote host IP address using proxy "X-Real-IP", "CF-Connecting-IP", "X-Forwarded-For" headers, or connection remote IP address. |
bool | TooManyRequests(...)Check if there are too many requests from the same IP address, using in-memory cache. |
HttpRequest extensions.
publicstaticstringGetRemoteAddress(HttpRequestrequest)| Type | Name | Description |
|---|---|---|
HttpRequest | request |
Get remote host IP address using proxy "X-Real-IP", "CF-Connecting-IP", "X-Forwarded-For" headers, or connection remote IP address.
IP address, or "Unknown" by default.
publicstaticboolTooManyRequests(HttpRequestrequest,intatTimeSeconds,intmaxRepeats)| Type | Name | Description |
|---|---|---|
HttpRequest | request | HTTP request. |
int | atTimeSeconds | Time period to check, default is 60 seconds. |
int | maxRepeats | Maximum number of requests for the specified time period, default is 1. |
Check if there are too many requests from the same IP address, using in-memory cache.
True if there are too many requests, otherwise false.
publicstaticboolTooManyRequests(HttpRequestrequest,TimeSpanatTime,intmaxRepeats)| Type | Name | Description |
|---|---|---|
HttpRequest | request | HTTP request. |
TimeSpan | atTime | Time period to check, default is 60 seconds. |
int | maxRepeats | Maximum number of requests for the specified time period, default is 1. |
Check if there are too many requests from the same IP address, using in-memory cache.
True if there are too many requests, otherwise false.
publicstaticboolTooManyRequests(stringip,TimeSpanatTime,intmaxRepeats)| Type | Name | Description |
|---|---|---|
string | ip | IP address. |
TimeSpan | atTime | Time period to check. |
int | maxRepeats | Maximum number of requests for the specified time period, default is 1. |
Check if there are too many requests from the same IP address, using in-memory cache.
True if there are too many requests, otherwise false.
Generated withModularDoc