Documentation ¶
Overview ¶
Package cors provides helpers to configure cross-origin resource sharing (CORS) for Connect servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedHeaders ¶
func AllowedHeaders() []string
AllowedHeaders returns the headers that scripts running in the browser send when making RPC requests. To support cross-domain requests with the protocols supported by Connect, these field names must be included in the Access-Control-Allow-Headers header of the preflight response.
When configuring CORS, make sure to also include any application-specific headers your server expects to receive from the browser.
func AllowedMethods ¶
func AllowedMethods() []string
AllowedMethods returns the allowed HTTP methods that scripts running in the browser are permitted to use.
To support cross-domain requests with the protocols supported by Connect, these headers fields must be included in the preflight response header Access-Control-Allow-Methods.
func ExposedHeaders ¶
func ExposedHeaders() []string
ExposedHeaders returns the headers that scripts running in the browser expect to access when receiving RPC responses. To support cross-domain requests with the protocols supported by Connect, these field names must be included in the Access-Control-Expose-Headers header of the actual response.
When configuring CORS, make sure to also include any application-specific headers your server expects to send to the browser. If your application uses trailers, they will be sent as headers with a `Trailer-` prefix for unary Connect RPCs - make sure to expose them!
Types ¶
This section is empty.