Skip to content

CORS, Health check, Stay on HTTP - #22

Merged
otmarnezdaril merged 1 commit into
mainfrom
cors-http-health-check
Aug 29, 2025
Merged

CORS, Health check, Stay on HTTP#22
otmarnezdaril merged 1 commit into
mainfrom
cors-http-health-check

Conversation

@otmarnezdaril

Copy link
Copy Markdown
Owner

No description provided.

@otmarnezdaril
otmarnezdaril merged commit 4b1fff5 into main Aug 29, 2025
1 check passed
@otmarnezdaril
otmarnezdaril deleted the cors-http-health-check branch August 29, 2025 20:53
@otmarnezdaril
otmarnezdaril requested a review from Copilot August 29, 2025 20:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR configures the API for containerized deployment by adding health checks, relaxing CORS policy, and disabling HTTPS redirection for HTTP-only container environments.

  • Added health check endpoint for container orchestration monitoring
  • Changed CORS policy from localhost-only to allow any origin
  • Disabled HTTPS redirection with explanatory comment for container compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

{
builder
.WithOrigins("http://localhost:3000", "https://localhost:3000")
.AllowAnyOrigin()

Copilot AI Aug 29, 2025

Copy link

Choose a reason for hiding this comment

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

Using AllowAnyOrigin() creates a security vulnerability by allowing requests from any domain. This should be restricted to specific trusted origins, especially in production environments. Consider using WithOrigins() with a configurable list of allowed domains.

Copilot uses AI. Check for mistakes.
app.UseCors("CorsPolicy");

app.UseHttpsRedirection();
//app.UseHttpsRedirection(); turned off because the container is http only

Copilot AI Aug 29, 2025

Copy link

Choose a reason for hiding this comment

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

Disabling HTTPS redirection removes an important security layer. Consider implementing HTTPS termination at the reverse proxy/load balancer level instead of disabling it entirely, or use environment-based configuration to conditionally enable HTTPS redirection.

Suggested change
//app.UseHttpsRedirection(); turned off because the container is http only
// Conditionally enable HTTPS redirection based on configuration
if (builder.Configuration.GetValue<bool>("EnableHttpsRedirection"))
{
app.UseHttpsRedirection();
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants