From 964400061d0afedf12ef3be495f665c3a1db7241 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 11 Dec 2023 13:08:02 -0500 Subject: [PATCH] Allow the constructor for `ProductHeaderValue` to accept a framework version of the object (#2821) --- Octokit/Http/ProductHeaderValue.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Octokit/Http/ProductHeaderValue.cs b/Octokit/Http/ProductHeaderValue.cs index 2879adf940..6d8cd32258 100644 --- a/Octokit/Http/ProductHeaderValue.cs +++ b/Octokit/Http/ProductHeaderValue.cs @@ -1,4 +1,6 @@ -namespace Octokit +using System; + +namespace Octokit { /// /// Represents a product header value. This is used to generate the User Agent string sent with each request. The @@ -38,9 +40,16 @@ public ProductHeaderValue(string name, string version) { } - ProductHeaderValue(System.Net.Http.Headers.ProductHeaderValue productHeader) + /// + /// Initializes a new instance of the class. + /// + /// + /// See more information regarding User-Agent requirements here: https://developer.github.com/v3/#user-agent-required + /// + /// The . + public ProductHeaderValue(System.Net.Http.Headers.ProductHeaderValue productHeader) { - _productHeaderValue = productHeader; + _productHeaderValue = productHeader ?? throw new ArgumentNullException(nameof(productHeader)); } ///