Automatically add CORS header to relay document response

This commit is contained in:
2024-01-13 21:16:33 +00:00
parent 4106b01c40
commit 5d349cf5f4

View File

@ -57,6 +57,11 @@ public static class Extensions
}
};
if (ctx.Response.Headers.AccessControlAllowOrigin.Count == 0)
{
ctx.Response.Headers.AccessControlAllowOrigin = "*";
}
ctx.Response.ContentType = "application/json";
await ctx.Response.WriteAsync(JsonConvert.SerializeObject(doc, NostrSerializer.Settings));
}