Preflight request doest not consider multiple methods for same path

Serverless Framework Version: 1.42.2

Actual Behavior:

When we have GET and DELETE methods on same path ; with custom headers (which will throw preflight request even for GET method) ; we have to duplicate cors declaration for both methods. We cannot have different origins.

  getOne:
    handler: handler.getOne
    events:
      - http:
          path: /{id}
          method: get
          cors:
            origin: 'getOneOrigin' 
            headers:
              [...]
            allowCredentials: true
  delete:
    handler: handler.delete
    events:
      - http:
          path: /{id}
          method: delete
          cors:
            origin: 'deleteOrigin'
            headers:
              [...]
            allowCredentials: true

With this code, a preflight request when we’re fetching GET method will reply with ‘deleteOrigin’ as cors origin.

Expected Behavior:

Preflight reply when GET is fetched has origin ‘getOneOrigin’ and not ‘deleteOrigin’

— Was previously closed after asking me to post this on serverless forum : https://github.com/serverless/serverless/issues/6278