Skip to content

Conversation

CheyuWu
Copy link
Contributor

@CheyuWu CheyuWu commented Sep 7, 2025

Why are these changes needed?

Currently, there is no allow CORS origin in the apiserversdk. So, we can add a middleware in apiserversdk if corsAllowOrigin is not an empty string.

Manaual Testing

$ go run cmd/main.go -httpPortFlag :31888 -cors-allow-origin=*

// another terminal
$ yarn dev
image image

Related issue number

Closes #4058

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@CheyuWu CheyuWu force-pushed the feat/apiserversdk/cors branch from 3c3dfcc to d5908bb Compare September 7, 2025 15:46
KubernetesConfig: kubernetesConfig,
})
}
if *corsAllowOrigin != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to merge these into the similar block below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem

@CheyuWu CheyuWu force-pushed the feat/apiserversdk/cors branch from 7e98a23 to 1a443e3 Compare September 10, 2025 16:50
@CheyuWu
Copy link
Contributor Author

CheyuWu commented Sep 10, 2025

Hi @rueian PTAL

@CheyuWu CheyuWu requested a review from rueian September 10, 2025 17:24
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.

[Feature] Add allow CORS in apiserversdk
2 participants