moved cross origin to writeAsync

This commit is contained in:
Florian Lang
2017-08-15 14:52:00 +02:00
parent 2ad10a5946
commit 84129da691

View File

@@ -121,7 +121,7 @@ namespace ArchiSteamFarm {
string response = await bot.Response(Program.GlobalConfig.SteamOwnerID, command).ConfigureAwait(false); string response = await bot.Response(Program.GlobalConfig.SteamOwnerID, command).ConfigureAwait(false);
ASF.ArchiLogger.LogGenericInfo(string.Format(Strings.IPCAnswered, command, response)); ASF.ArchiLogger.LogGenericInfo(string.Format(Strings.IPCAnswered, command, response));
context.Response.AppendHeader("Access-Control-Allow-Origin", "null");
await context.Response.WriteAsync(HttpStatusCode.OK, response).ConfigureAwait(false); await context.Response.WriteAsync(HttpStatusCode.OK, response).ConfigureAwait(false);
break; break;
} }
@@ -167,6 +167,8 @@ namespace ArchiSteamFarm {
response.StatusCode = (ushort) statusCode; response.StatusCode = (ushort) statusCode;
} }
response.AppendHeader("Access-Control-Allow-Origin", "null");
Encoding encoding = Encoding.UTF8; Encoding encoding = Encoding.UTF8;
response.ContentEncoding = encoding; response.ContentEncoding = encoding;