Skip to content

Commit 59e510f

Browse files
committed
server: tighten up cors rules
1 parent f127117 commit 59e510f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/httpapi/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ func (s *Server) GetOpenAPI() string {
5656
func NewServer(ctx context.Context, agentType mf.AgentType, process *termexec.Process, port int) *Server {
5757
router := chi.NewMux()
5858

59-
// Setup CORS middleware
6059
corsMiddleware := cors.New(cors.Options{
61-
AllowedOrigins: []string{"http://localhost:3000", "*"},
60+
// coder.github.io hosts the chat demo
61+
AllowedOrigins: []string{"http://localhost:3000", "https://coder.github.io"},
6262
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
6363
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
6464
ExposedHeaders: []string{"Link"},

0 commit comments

Comments
 (0)