mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:57:32 +00:00
fix(api): CORS for connectRPC and grpc-web (#10227)
# Which Problems Are Solved The CORS handler for the new connectRPC handlers was missing, leading to unhandled preflight requests and a unusable api for browser based calls, e.g. cross domain gRPC-web requests. # How the Problems Are Solved - Added the http CORS middleware to the connectRPC handlers. - Added `Grpc-Timeout`, `Connect-Protocol-Version`,`Connect-Timeout-Ms` to the default allowed headers (this improves also the old grpc-web handling) - Added `Grpc-Status`, `Grpc-Message`, `Grpc-Status-Details-Bin` to the default exposed headers (this improves also the old grpc-web handling) # Additional Changes None # Additional Context noticed internally while testing other issues
This commit is contained in:
@@ -201,7 +201,7 @@ func (a *API) registerConnectServer(service server.ConnectServer) {
|
||||
methodNames[i] = string(methods.Get(i).Name())
|
||||
}
|
||||
a.connectServices[prefix] = methodNames
|
||||
a.RegisterHandlerPrefixes(handler, prefix)
|
||||
a.RegisterHandlerPrefixes(http_mw.CORSInterceptor(handler), prefix)
|
||||
}
|
||||
|
||||
// HandleFunc allows registering a [http.HandlerFunc] on an exact
|
||||
|
Reference in New Issue
Block a user