From 6ae2adc1af9199dd348c30070c9b2e26699a5169 Mon Sep 17 00:00:00 2001 From: isamu arimoto Date: Thu, 9 Jan 2025 04:28:11 +0900 Subject: [PATCH] openai: accept additional headers to fix CORS errors (#8343) --- server/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes.go b/server/routes.go index 543b823d6..c2ec360ab 100644 --- a/server/routes.go +++ b/server/routes.go @@ -1131,7 +1131,7 @@ func (s *Server) GenerateRoutes() http.Handler { config.AllowWildcard = true config.AllowBrowserExtensions = true config.AllowHeaders = []string{"Authorization", "Content-Type", "User-Agent", "Accept", "X-Requested-With"} - openAIProperties := []string{"lang", "package-version", "os", "arch", "retry-count", "runtime", "runtime-version", "async"} + openAIProperties := []string{"lang", "package-version", "os", "arch", "retry-count", "runtime", "runtime-version", "async", "helper-method", "poll-helper", "custom-poll-interval"} for _, prop := range openAIProperties { config.AllowHeaders = append(config.AllowHeaders, "x-stainless-"+prop) }