Skip to content

Commit 9132c20

Browse files
committed
Add user agent to web request details
This allows us to quickly identify if spesific browsers are the cause of errors or problems (especially useful to detect crawlers attempting paths or queries they clearly shouldn't).
1 parent b6a151c commit 9132c20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Src/StackifyLib/Models/WebRequestDetail.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ public WebRequestDetail(StackifyError error)
4747
[JsonProperty]
4848
public string ReportingUrl { get; set; }
4949

50-
5150
[JsonProperty]
5251
public string ReferralUrl { get; set; }
5352

53+
[JsonProperty]
54+
public string UserAgent { get; set; }
55+
5456
[JsonProperty]
5557
public Dictionary<string, string> Headers { get; set; }
5658

@@ -90,6 +92,7 @@ private void Load(HttpContext context)
9092
{
9193
HttpMethod = request.RequestType;
9294
UserIPAddress = request.UserHostAddress;
95+
UserAgent = request.UserAgent;
9396

9497
if (context.Items != null && context.Items.Contains("Stackify.ReportingUrl"))
9598
{

0 commit comments

Comments
 (0)