Skip to content

Instantly share code, notes, and snippets.

@enkelmedia
Created April 8, 2019 13:09
Show Gist options
  • Save enkelmedia/629012286eb20173b471963cae40e35a to your computer and use it in GitHub Desktop.
Save enkelmedia/629012286eb20173b471963cae40e35a to your computer and use it in GitHub Desktop.
/// <summary>
/// Just used to record an incomming request to see any headers passed from CloudFront to the Win2012-server.
/// Routes to: /umbraco/surface/contactmesurface/recordrequest
/// </summary>
/// <returns></returns>
public ActionResult RecordRequest()
{
var path = Server.MapPath("~/app_data/logs/") + DateTime.Now.ToString("yyyyMMdd-hhmmss_") + ".txt";
string headers = String.Empty;
foreach (var key in Request.Headers.AllKeys)
headers += key + "=" + Request.Headers[key] + Environment.NewLine;
System.IO.File.WriteAllText(path,headers);
return Content("Yess");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment