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

Sync subscription CORS configuration #328

@mthenw

Description

@mthenw

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions