Skip to content

Commit c441a11

Browse files
committed
Regenete csharp sample
1 parent a58c267 commit c441a11

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

  • samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Client

samples/client/petstore/csharp/generichost/latest/NullTypes/src/Org.OpenAPITools/Client/ClientUtils.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,35 @@ public static bool IsJsonMime(string mime)
301301
throw new JsonException("The specified discriminator was not found.");
302302
}
303303

304+
/// <summary>
305+
/// Determines if the provided header is a content header
306+
/// </summary>
307+
/// <param name="header">The header to check</param>
308+
/// <returns>True if a content header; False otherwise</returns>
309+
public static bool IsContentHeader(string header)
310+
{
311+
return ContentHeaders.Contains(header.ToLowerInvariant());
312+
}
313+
314+
/// <summary>
315+
/// The collection of content headers as per
316+
/// https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent.headers
317+
/// </summary>
318+
private static readonly string[] ContentHeaders = new String[]
319+
{
320+
"allow",
321+
"content-encoding",
322+
"content-disposition",
323+
"content-language",
324+
"content-length",
325+
"content-location",
326+
"content-md5",
327+
"content-range",
328+
"content-type",
329+
"expires",
330+
"last-modified"
331+
};
332+
304333
/// <summary>
305334
/// The base path of the API
306335
/// </summary>

0 commit comments

Comments
 (0)