The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Microsoft.AspNetCore.Http;
  2. using Microsoft.AspNetCore.Http.Extensions;
  3. using Microsoft.AspNetCore.Mvc.Filters;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Web;
  10. using Teknik.Configuration;
  11. using Teknik.Piwik;
  12. using Teknik.Utilities;
  13. namespace Teknik.Filters
  14. {
  15. public class TrackLink : ActionFilterAttribute
  16. {
  17. public TrackLink()
  18. {
  19. //_config = config;
  20. }
  21. public override void OnActionExecuting(ActionExecutingContext filterContext)
  22. {
  23. }
  24. public override void OnActionExecuted(ActionExecutedContext filterContext)
  25. {
  26. //HttpRequest request = filterContext.HttpContext.Request;
  27. //string doNotTrack = request.Headers["DNT"];
  28. //if (string.IsNullOrEmpty(doNotTrack) || doNotTrack != "1")
  29. //{
  30. // string userAgent = request.Headers["User-Agent"].ToString();
  31. // string clientIp = request.ClientIPFromRequest(true);
  32. // string urlReferrer = request.Headers["Referer"].ToString();
  33. // string url = UriHelper.GetEncodedUrl(request);
  34. // // Fire and forget. Don't need to wait for it.
  35. // Tracking.TrackLink(_config, userAgent, clientIp, url, urlReferrer);
  36. //}
  37. }
  38. }
  39. }