| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // Copied from https://github.com/aspnet/AspNetCore/tree/master/src/Http/WebUtilities/src |
| | 5 | |
|
| | 6 | | using System.Collections.Generic; |
| | 7 | | using System.IO; |
| | 8 | |
|
| | 9 | | #pragma warning disable IDE0018 // Inline declaration |
| | 10 | |
|
| | 11 | | namespace Azure.Core.Http.Multipart |
| | 12 | | { |
| | 13 | | internal class MultipartSection |
| | 14 | | { |
| | 15 | | public string ContentType |
| | 16 | | { |
| | 17 | | get |
| | 18 | | { |
| | 19 | | StringValues values; |
| 0 | 20 | | if (Headers.TryGetValue(HeaderNames.ContentType, out values)) |
| | 21 | | { |
| 0 | 22 | | return values; |
| | 23 | | } |
| 0 | 24 | | return null; |
| | 25 | | } |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public string ContentDisposition |
| | 29 | | { |
| | 30 | | get |
| | 31 | | { |
| | 32 | | StringValues values; |
| 0 | 33 | | if (Headers.TryGetValue(HeaderNames.ContentDisposition, out values)) |
| | 34 | | { |
| 0 | 35 | | return values; |
| | 36 | | } |
| 0 | 37 | | return null; |
| | 38 | | } |
| | 39 | | } |
| | 40 | |
|
| 2544 | 41 | | public Dictionary<string, StringValues> Headers { get; set; } |
| | 42 | |
|
| 2544 | 43 | | public Stream Body { get; set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// The position where the body starts in the total multipart body. |
| | 47 | | /// This may not be available if the total multipart body is not seekable. |
| | 48 | | /// </summary> |
| 0 | 49 | | public long? BaseStreamOffset { get; set; } |
| | 50 | | } |
| | 51 | | } |