From 9f1a4f613465e16f0d6501f3bcefcd5f471d8b21 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 25 Aug 2023 18:06:33 +0100 Subject: [PATCH] Enable CORS --- NostrStreamer/Controllers/LnurlController.cs | 2 ++ NostrStreamer/Controllers/NostrController.cs | 3 ++- NostrStreamer/Controllers/PlaylistController.cs | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NostrStreamer/Controllers/LnurlController.cs b/NostrStreamer/Controllers/LnurlController.cs index de57344..1ba81c2 100644 --- a/NostrStreamer/Controllers/LnurlController.cs +++ b/NostrStreamer/Controllers/LnurlController.cs @@ -2,6 +2,7 @@ using System.Security.Cryptography; using System.Text; using BTCPayServer.Lightning; using LNURL; +using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Nostr.Client.Json; @@ -13,6 +14,7 @@ using NostrStreamer.Services; namespace NostrStreamer.Controllers; [Route("/api/pay")] +[EnableCors] public class LnurlController : Controller { private readonly Config _config; diff --git a/NostrStreamer/Controllers/NostrController.cs b/NostrStreamer/Controllers/NostrController.cs index 228bd67..eee767f 100644 --- a/NostrStreamer/Controllers/NostrController.cs +++ b/NostrStreamer/Controllers/NostrController.cs @@ -1,10 +1,10 @@ using System.Security.Claims; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using Nostr.Client.Json; -using Nostr.Client.Messages; using NostrStreamer.ApiModel; using NostrStreamer.Database; using NostrStreamer.Services; @@ -13,6 +13,7 @@ using NostrStreamer.Services.StreamManager; namespace NostrStreamer.Controllers; [Authorize] +[EnableCors] [Route("/api/nostr")] public class NostrController : Controller { diff --git a/NostrStreamer/Controllers/PlaylistController.cs b/NostrStreamer/Controllers/PlaylistController.cs index 1d52ab0..2613120 100644 --- a/NostrStreamer/Controllers/PlaylistController.cs +++ b/NostrStreamer/Controllers/PlaylistController.cs @@ -1,5 +1,6 @@ using System.Text.RegularExpressions; using MediaFormatLibrary.MP4; +using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using NostrStreamer.Database; using NostrStreamer.Services; @@ -8,6 +9,7 @@ using NostrStreamer.Services.StreamManager; namespace NostrStreamer.Controllers; [Route("/api/playlist")] +[EnableCors] public class PlaylistController : Controller { private readonly ILogger _logger;