|
|
@@ -34,6 +34,9 @@ namespace TBConsole |
|
|
|
{ |
|
|
|
var context = await _listener.GetContextAsync(); |
|
|
|
string resp = await _receiver(await new StreamReader(context.Request.InputStream).ReadToEndAsync()); |
|
|
|
string origin = context.Request.Headers["Origin"]; |
|
|
|
if (origin == "http://localhost:4200" || origin == "https://tbconsole.web.app") |
|
|
|
context.Response.AddHeader("Access-Control-Allow-Origin", origin); |
|
|
|
var sw = new StreamWriter(context.Response.OutputStream); |
|
|
|
await sw.WriteLineAsync(resp); |
|
|
|
sw.Close(); |
|
|
|