Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
policy.AllowAnyMethod();
});

// Swagger UI
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("./openapi.yaml", "v1");
options.RoutePrefix = "";
});

// This must come BEFORE UseSwaggerUI
app.UseStaticFiles(new StaticFileOptions
{
// Serve openapi.yaml file
ServeUnknownFileTypes = true,
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting ServeUnknownFileTypes to true is a potential security risk as it allows serving files with any extension without proper MIME type validation. Consider using FileExtensionContentTypeProvider to explicitly allow only the .yaml extension instead.

Copilot uses AI. Check for mistakes.
});

// Swagger UI
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("./openapi.yaml", "v1");
options.RoutePrefix = "";
});

app.MapGroup("/lists")
.MapTodoApi()
Expand Down
Loading