Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the constructor for ProductHeaderValue to accept a framework version of the object #2821

Merged
merged 1 commit into from Dec 11, 2023

Conversation

Cyberboss
Copy link
Contributor

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

I think this is fairly straightforward. Currently, if you already have a System.Net.Http.Headers.ProductHeaderValue, you have to deconstruct it to pass it to the Octokit constructor. Then, it proceeds to just make an unnecessary copy of it.

Simplify things by allowing one to be passed in directly.

/// See more information regarding User-Agent requirements here: https://developer.github.com/v3/#user-agent-required
/// </remarks>
/// <param name="name">The <see cref="System.Net.Http.Headers.ProductHeaderValue"/>.</param>
public ProductHeaderValue(System.Net.Http.Headers.ProductHeaderValue productHeader)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the meaningful part of the change? I'm having a hard time figuring out how the internal _productHeaderValue was set before the change.

Copy link
Contributor Author

@Cyberboss Cyberboss Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changing of the constructor from private to public is the meaningful bit yeah. All other constructors call it.

@kfcampbell kfcampbell merged commit 9644000 into octokit:main Dec 11, 2023
5 checks passed
@Cyberboss Cyberboss deleted the patch-5 branch December 11, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants