Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:iRebbok/DSharp4Webhook into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
iRebbok committed Jun 4, 2020
2 parents 0be3533 + 34932b0 commit 6166a1f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/DSharp4Webhook.Rest.Mono/MonoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void PrepareRequest(HttpWebRequest request, Stream requestStream, Serial
requestStream.Write(context.Content, 0, context.Content.Length);
break;
}
case SerializeType.MULTIPART_FROM_DATA:
case SerializeType.MULTIPART_FORM_DATA:
{
MultipartHelper.PrepareMultipartFormDataRequest(request, requestStream, context);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/DSharp4Webhook/Rest/DefaultProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void PrepareContent(HttpRequestMessage requestMessage, SerializeContext
break;
}

case SerializeType.MULTIPART_FROM_DATA:
case SerializeType.MULTIPART_FORM_DATA:
{
var multipartContent = new MultipartFormDataContent();
if (!(data.Files is null) && data.Files.Keys.Count != 0)
Expand Down
8 changes: 4 additions & 4 deletions src/DSharp4Webhook/Serialization/SerializeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public SerializeContext(byte[]? content, byte[]? data, string? fileName = null)

if (!(data is null))
{
Type = SerializeType.MULTIPART_FROM_DATA;
Type = SerializeType.MULTIPART_FORM_DATA;
#pragma warning disable CS8604 // Possible null reference argument.
Files = new Dictionary<string, byte[]> { [fileName] = data };
#pragma warning restore CS8604 // Possible null reference argument.
Expand All @@ -80,7 +80,7 @@ public SerializeContext(byte[]? content, byte[]? data, string? fileName = null)
public SerializeContext(byte[]? content, Dictionary<string, byte[]>? files = null)
#nullable restore
{
Type = files is null || (files?.Count ?? 0) < 1 ? SerializeType.APPLICATION_JSON : SerializeType.MULTIPART_FROM_DATA;
Type = files is null || (files?.Count ?? 0) < 1 ? SerializeType.APPLICATION_JSON : SerializeType.MULTIPART_FORM_DATA;
Content = content;
Files = files;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ public SerializeContext(byte[] data, string? fileName = null)
Checks.CheckForNull(data, nameof(data));
fileName = string.IsNullOrWhiteSpace(fileName) ? Guid.NewGuid().ToString() : fileName;

Type = SerializeType.MULTIPART_FROM_DATA;
Type = SerializeType.MULTIPART_FORM_DATA;
#pragma warning disable CS8604 // Possible null reference argument.
Files = new Dictionary<string, byte[]> { [fileName] = data };
#pragma warning restore CS8604 // Possible null reference argument.
Expand Down Expand Up @@ -161,7 +161,7 @@ public void AddFile(byte[] data, string? fileName = null)
{
Files = new Dictionary<string, byte[]>();
// The format changes when a new file is added
Type = SerializeType.MULTIPART_FROM_DATA;
Type = SerializeType.MULTIPART_FORM_DATA;
}
// Setting the value forcibly even if it exists
#pragma warning disable CS8604 // Possible null reference argument.
Expand Down
4 changes: 2 additions & 2 deletions src/DSharp4Webhook/Serialization/SerializeType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace DSharp4Webhook.Serialization
/// </summary>
public enum SerializeType
{
MULTIPART_FROM_DATA,
MULTIPART_FORM_DATA,
APPLICATION_JSON
}

Expand All @@ -22,7 +22,7 @@ public static string Convert(SerializeType type)
{
case SerializeType.APPLICATION_JSON:
return "application/json";
case SerializeType.MULTIPART_FROM_DATA:
case SerializeType.MULTIPART_FORM_DATA:
return "multipart/form-data";
}

Expand Down

0 comments on commit 6166a1f

Please sign in to comment.