Skip to content

Commit 49e79ec

Browse files
committed
Ensure user agent
1 parent f47e8e7 commit 49e79ec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/https/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ public async Task<int> RunAsync(string[] args)
219219
}
220220
}
221221

222+
if (!request.Headers.UserAgent.Any())
223+
{
224+
request.Headers.UserAgent.Add(
225+
new ProductInfoHeaderValue(
226+
"dotnet-https",
227+
typeof(Program).Assembly.GetName().Version.ToString()
228+
)
229+
);
230+
}
231+
222232
try
223233
{
224234
var response = await http.SendAsync(request);

0 commit comments

Comments
 (0)