Skip to content

feat(http): add cors flags#372

Merged
adrienaury merged 6 commits into
mainfrom
371-add-configurable-cors-support-to-http-command
Jun 6, 2025
Merged

feat(http): add cors flags#372
adrienaury merged 6 commits into
mainfrom
371-add-configurable-cors-support-to-http-command

Conversation

@youen

@youen youen commented Jun 4, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@youen youen linked an issue Jun 4, 2025 that may be closed by this pull request
@youen
youen marked this pull request as draft June 4, 2025 06:40
@youen
youen marked this pull request as ready for review June 4, 2025 07:02
@youen
youen requested a review from adrienaury June 4, 2025 07:02
Comment thread README.md Outdated
@adrienaury
adrienaury requested a review from Copilot June 4, 2025 07:21

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

Adds configurable CORS support to the lino http sub-command, allowing users to enable CORS and specify allowed origins, methods, and headers.

  • Introduce --enable-cors, --cors-origins, --cors-methods, and --cors-headers flags and wrap the HTTP handler in CORS middleware when enabled
  • Add github.com/rs/cors dependency in go.mod
  • Document the new flags in README.md and record the feature in CHANGELOG.md

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
internal/app/http/cli.go Added CORS flags and conditional middleware wrap
go.mod Added github.com/rs/cors dependency
README.md Documented HTTP sub-command and CORS configuration
CHANGELOG.md Logged new CORS feature under version 3.3.0
Comments suppressed due to low confidence (3)

internal/app/http/cli.go:76

  • New CORS logic is introduced but no tests have been added to verify CORS headers. Consider adding unit or integration tests to confirm proper CORS responses when enabled.
if enableCORS {

README.md:607

  • Duplicate "### CORS Configuration" heading found on lines 603 and 607; remove the redundant section to avoid confusion.
### CORS Configuration

internal/app/http/cli.go:77

  • [nitpick] The variable name c is ambiguous; consider renaming it to corsHandler or corsMiddleware for improved clarity.
c := cors.New(cors.Options{

Comment thread internal/app/http/cli.go
@youen
youen requested a review from adrienaury June 5, 2025 13:51
@adrienaury
adrienaury merged commit 71b665f into main Jun 6, 2025
3 checks passed
@adrienaury
adrienaury deleted the 371-add-configurable-cors-support-to-http-command branch June 6, 2025 09:05
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.

Add configurable CORS support to http command

3 participants