Skip to content

corsify creating unused readable stream #26

Description

@0xCaliburSigma

Error:

A ReadableStream branch was created but never consumed. Such branches can be created, for instance, by calling the tee() method on a ReadableStream, or by calling the clone() method on a Request or Response object. If a branch is created but never consumed, it can force the runtime to buffer the entire body of the stream in memory, which may cause the Worker to exceed its memory limit and be terminated. To avoid this, ensure that all branches created are consumed.

  • Unused stream created:
    at corsify (index.js:62:113)
    at index.js:305:93

Code:

const { preflight, corsify } = cors({ origin: '*', allowMethods: ['GET'] });

const router = AutoRouter({
  base: '/',
  before: [preflight, customMiddleware],
  finally: [corsify]
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions