Skip to content

Commit

Permalink
Improve API documentation
Browse files Browse the repository at this point in the history
This extends the documentation for `HttpUtils.GetContentEncoding()` to
mention where the value is taken from, and that it will always be in
lower case.
  • Loading branch information
Zastai committed Dec 12, 2023
1 parent 16f099b commit eef28d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MetaBrainz.Common/HttpUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public static HttpResponseMessage EnsureSuccessful(this HttpResponseMessage resp
/// <summary>Gets the content encoding based on content headers.</summary>
/// <param name="contentHeaders">The headers to get the information from.</param>
/// <returns>
/// The content encoding extracted from the headers, or "utf-8" as fallback if no explicit specification was found.
/// The content encoding extracted from the headers (first from the <c>Content-Encoding</c> header, then from a <c>charset</c>
/// specification as part of the <c>Content-Type</c> header), mapped to lower case; uses "utf-8" as fallback if no explicit
/// specification was found.
/// </returns>
public static string GetContentEncoding(this HttpContentHeaders contentHeaders) {
var characterSet = contentHeaders.ContentEncoding.FirstOrDefault();
Expand Down

0 comments on commit eef28d8

Please sign in to comment.