Automatically add CORS header to relay document response
This commit is contained in:
@ -57,6 +57,11 @@ public static class Extensions
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (ctx.Response.Headers.AccessControlAllowOrigin.Count == 0)
|
||||||
|
{
|
||||||
|
ctx.Response.Headers.AccessControlAllowOrigin = "*";
|
||||||
|
}
|
||||||
|
|
||||||
ctx.Response.ContentType = "application/json";
|
ctx.Response.ContentType = "application/json";
|
||||||
await ctx.Response.WriteAsync(JsonConvert.SerializeObject(doc, NostrSerializer.Settings));
|
await ctx.Response.WriteAsync(JsonConvert.SerializeObject(doc, NostrSerializer.Settings));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user