1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

Reformat and apply Stylecop rules

This commit is contained in:
ta264
2019-12-22 22:08:53 +00:00
committed by Qstick
parent d4fa9b7345
commit f02fa629cc
1186 changed files with 7105 additions and 5616 deletions
+18 -7
View File
@@ -46,7 +46,6 @@ namespace NzbDrone.Common.Http
public HttpRequestBuilder(bool useHttps, string host, int port, string urlBase = null)
: this(BuildBaseUrl(useHttps, host, port, urlBase))
{
}
public static string BuildBaseUrl(bool useHttps, string host, int port, string urlBase = null)
@@ -148,7 +147,10 @@ namespace NzbDrone.Common.Http
protected virtual void ApplyFormData(HttpRequest request)
{
if (FormData.Empty()) return;
if (FormData.Empty())
{
return;
}
if (request.ContentData != null)
{
@@ -173,11 +175,22 @@ namespace NzbDrone.Common.Http
writer.Write(partBoundary);
writer.Write("Content-Disposition: form-data");
if (formData.Name.IsNotNullOrWhiteSpace()) writer.Write("; name=\"{0}\"", formData.Name);
if (formData.FileName.IsNotNullOrWhiteSpace()) writer.Write("; filename=\"{0}\"", formData.FileName);
if (formData.Name.IsNotNullOrWhiteSpace())
{
writer.Write("; name=\"{0}\"", formData.Name);
}
if (formData.FileName.IsNotNullOrWhiteSpace())
{
writer.Write("; filename=\"{0}\"", formData.FileName);
}
writer.Write("\r\n");
if (formData.ContentType.IsNotNullOrWhiteSpace()) writer.Write("Content-Type: {0}\r\n", formData.ContentType);
if (formData.ContentType.IsNotNullOrWhiteSpace())
{
writer.Write("Content-Type: {0}\r\n", formData.ContentType);
}
writer.Write("\r\n");
writer.Flush();
@@ -201,7 +214,6 @@ namespace NzbDrone.Common.Http
var body = bodyStream.ToArray();
// TODO: Scan through body to see if we have a boundary collision?
request.Headers.ContentType = "multipart/form-data; boundary=" + boundary;
request.SetContent(body);
@@ -379,5 +391,4 @@ namespace NzbDrone.Common.Http
return this;
}
}
}