Automatically add CORS header to relay document response
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Kieran 2024-01-13 21:16:33 +00:00
parent 4106b01c40
commit 5d349cf5f4
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 5 additions and 0 deletions

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));
}