You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
530 B
19 lines
530 B
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http.Extensions;
|
|
|
|
namespace Infrastructure.Extensions
|
|
{
|
|
public static class HttpRequestExtensions
|
|
{
|
|
public static bool IsAjax(this HttpRequest request)
|
|
{
|
|
var key = "x-requested-with";
|
|
return request.Headers.ContainsKey(key) && request.Headers[key] == "XMLHttpRequest";
|
|
}
|
|
|
|
public static string GetUrl(this HttpRequest request)
|
|
{
|
|
return UriHelper.GetEncodedUrl(request);
|
|
}
|
|
}
|
|
} |