Update Emby.Server.Implementations/HttpServer/HttpListenerHost.cs from review

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
Frank Riley 2020-05-13 15:57:40 -07:00
parent 3cb6fd8a27
commit c70c589236

View File

@ -455,9 +455,9 @@ namespace Emby.Server.Implementations.HttpServer
if (string.Equals(httpReq.Verb, "OPTIONS", StringComparison.OrdinalIgnoreCase)) if (string.Equals(httpReq.Verb, "OPTIONS", StringComparison.OrdinalIgnoreCase))
{ {
httpRes.StatusCode = 200; httpRes.StatusCode = 200;
foreach(KeyValuePair<string, string> header in GetCorsHeaders(httpReq)) foreach(var (key, value) in GetCorsHeaders(httpReq))
{ {
httpRes.Headers.Add(header.Key, header.Value); httpRes.Headers.Add(key, value);
} }
httpRes.ContentType = "text/plain"; httpRes.ContentType = "text/plain";
await httpRes.WriteAsync(string.Empty, cancellationToken).ConfigureAwait(false); await httpRes.WriteAsync(string.Empty, cancellationToken).ConfigureAwait(false);