Skip to content

CORS, Health check, Stay on HTTP#22

Merged
otheec merged 1 commit intomainfrom
cors-http-health-check
Aug 29, 2025
Merged

CORS, Health check, Stay on HTTP#22
otheec merged 1 commit intomainfrom
cors-http-health-check

Conversation

@otheec
Copy link
Copy Markdown
Owner

@otheec otheec commented Aug 29, 2025

No description provided.

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

Copilot AI left a comment

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()
Copy link

Copilot AI Aug 29, 2025

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
Copy link

Copilot AI Aug 29, 2025

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