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

middlewares: limit process.env to inferred usage #33186

Merged

Commits on Jan 11, 2022

  1. middlewares: limit process.env to inferred usage

    Production middlewares will only expose env vars that are statically
    analyzable, as mentioned here: https://nextjs.org/docs/api-reference/next/server#how-do-i-access-environment-variables
    
    This creates some incompatibility with `next dev` and `next start`,
    where all `process.env` data is shared and can lead to unexpected
    behavior in runtime.
    
    This PR fixes it by limiting the data in `process.env` with the inferred
    env vars from the code usage.
    Schniz committed Jan 11, 2022
    Copy the full SHA
    3e8a960 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    39c3207 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2022

  1. Copy the full SHA
    4dbec5d View commit details
    Browse the repository at this point in the history
  2. use constant

    Schniz committed Jan 12, 2022
    Copy the full SHA
    bdd9a17 View commit details
    Browse the repository at this point in the history
  3. Check runtimes for both cases for consistency

    Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
    Schniz and sokra committed Jan 12, 2022
    Copy the full SHA
    9b75923 View commit details
    Browse the repository at this point in the history
  4. lint fix

    Schniz committed Jan 12, 2022
    Copy the full SHA
    577a44c View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    1bd0e19 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    31d50be View commit details
    Browse the repository at this point in the history