microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e2efe052792ba394b46f2004d1390a3cdfcd0c1e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Bot.Core/HttpRequestExtensions.cs

18lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.AspNetCore.Http;
5
6namespace Microsoft.Teams.Bot.Core;
7
8/// <summary>
9/// Extension methods for <see cref="HttpRequest"/>.
10/// </summary>
11public static class HttpRequestExtensions
12{
13 /// <summary>
14 /// Gets the Microsoft Correlation Vector (MS-CV) from the request headers, if present.
15 /// </summary>
16 public static string? GetCorrelationVector(this HttpRequest request)
17 => request != null ? request.Headers["MS-CV"].FirstOrDefault() : string.Empty;
18}
19