Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when mutating res if not streaming #30284

Merged
merged 2 commits into from Oct 26, 2021
Merged

Warn when mutating res if not streaming #30284

merged 2 commits into from Oct 26, 2021

Commits on Oct 25, 2021

  1. Warn when mutating res if not streaming

    In vercel#29010, we started throwing an error if the res was mutated after
    getServerSideProps() returned. This was to support classic streaming,
    where it would be possible to accidentally mutate the response headers
    after they were already sent. However, this change also caught [a few
    non-streaming cases](vercel#29010 (comment)) that we don't want to break.
    
    As such, with this change, we only throw the error if res is mutated
    after gSSP returns *and* you've opted into using classic streaming.
    Otherwise, we will only add a warning to the console.
    kara committed Oct 25, 2021
    Copy the full SHA
    0d51e2d View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    2730e4b View commit details
    Browse the repository at this point in the history