This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Description
This is a Feature Proposal
Right now the event gateway allows all methods, headers, origins
|
handler := &http.Server{ |
|
Addr: ":" + strconv.Itoa(int(config.Port)), |
|
Handler: cors.AllowAll().Handler(router), |
|
ReadTimeout: 3 * time.Second, |
|
WriteTimeout: 3 * time.Second, |
|
} |
CORS configuration should be per HTTP subscription. HTTP subscription should allow specifying additional cors field with the following structure (and default values):
{
"cors": {
"origins": [], // default "*"
"methods": [], // default ["GET", "POST"]
"headers": [], // default ["Content-Type", "Authorization"]
"allowCredentials": false // default "false"
}
}
origins is an array but actually, it should return only matched origin in the request. See #16.
Similar or dependent issues: