Skip to content

Commit 7eaedec

Browse files
committed
fix: update CORS policy name and add additional origins for GitHub Pages
1 parent 8d88800 commit 7eaedec

File tree

1 file changed

+3
-3
lines changed
  • src/c-sharp/JakubKozera.OpenApiUi.Sample

1 file changed

+3
-3
lines changed

src/c-sharp/JakubKozera.OpenApiUi.Sample/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@
8383
// Add CORS for GitHub Pages
8484
builder.Services.AddCors(options =>
8585
{
86-
options.AddPolicy("GitHubPages", policy =>
86+
options.AddPolicy("CorsValidOrigins", policy =>
8787
{
88-
policy.WithOrigins("https://jakubkozera.github.io", "http://localhost:5501")
88+
policy.WithOrigins("https://jakubkozera.github.io", "http://localhost:5501", "https://*.vscode-webview.net", "vscode-webview://*")
8989
.AllowAnyMethod()
9090
.AllowAnyHeader()
9191
.AllowCredentials();
@@ -95,7 +95,7 @@
9595
var app = builder.Build();
9696

9797
// Enable CORS
98-
app.UseCors("GitHubPages");
98+
app.UseCors("CorsValidOrigins");
9999

100100
app.UseAuthentication();
101101
app.UseAuthorization();

0 commit comments

Comments
 (0)