microsoft/teams.net
Publicmirrored from https://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Bot.Core/HttpRequestExtensions.cs
18lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using Microsoft.AspNetCore.Http; |
| 5 | |
| 6 | namespace Microsoft.Teams.Bot.Core; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// Extension methods for <see cref="HttpRequest"/>. |
| 10 | /// </summary> |
| 11 | public 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 | |