Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: expressjs/express
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3d7fce56a35f4f73fa437866cd1401587a212334
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8e229f92752ad51462c868b99f6e6c2e559801b0
Choose a head ref

Commits on Feb 21, 2022

  1. Copy the full SHA
    8ee3420 View commit details
  2. Copy the full SHA
    d8ed591 View commit details

Commits on Feb 22, 2022

  1. Copy the full SHA
    7df0c84 View commit details
  2. Copy the full SHA
    9967ffb View commit details
  3. Copy the full SHA
    bc5ca05 View commit details

Commits on Feb 23, 2022

  1. Copy the full SHA
    18f782b View commit details
  2. Copy the full SHA
    8da8f79 View commit details

Commits on Feb 24, 2022

  1. Copy the full SHA
    cf9f662 View commit details

Commits on Feb 28, 2022

  1. docs: fix typo in private api jsdoc

    closes #4843
    apeltop authored and dougwilson committed Feb 28, 2022
    Copy the full SHA
    d0e166c View commit details

Commits on Mar 1, 2022

  1. Copy the full SHA
    ea66a9b View commit details
  2. Copy the full SHA
    4ed35b4 View commit details
  3. Copy the full SHA
    07aa91f View commit details
  4. docs: add install size badge

    closes #3710
    styfle authored and dougwilson committed Mar 1, 2022
    Copy the full SHA
    e8594c3 View commit details
  5. Copy the full SHA
    291993d View commit details
  6. build: mocha@9.2.1

    dougwilson committed Mar 1, 2022
    Copy the full SHA
    446046f View commit details

Commits on Mar 20, 2022

  1. Copy the full SHA
    490f1a1 View commit details
  2. examples: fixup html

    closes #4866
    Hashen110 authored and dougwilson committed Mar 20, 2022
    Copy the full SHA
    2a7417d View commit details

Commits on Mar 21, 2022

  1. docs: fix incomplete JSDoc comment

    closes #4867
    Hashen110 authored and dougwilson committed Mar 21, 2022
    Copy the full SHA
    bf4c3ee View commit details
  2. Copy the full SHA
    947b6b7 View commit details

Commits on Mar 24, 2022

  1. build: support Node.js 15.x

    kkalavantavanich authored and dougwilson committed Mar 24, 2022
    Copy the full SHA
    eb4c930 View commit details
  2. build: support Node.js 16.x

    kkalavantavanich authored and dougwilson committed Mar 24, 2022
    Copy the full SHA
    8bf0720 View commit details
  3. Support proper 205 responses using res.send

    closes #4592
    closes #4596
    tkesgar authored and dougwilson committed Mar 24, 2022
    Copy the full SHA
    87279c0 View commit details
  4. Copy the full SHA
    c17fe05 View commit details
  5. Copy the full SHA
    4847d0e View commit details

Commits on Mar 25, 2022

  1. Add "root" option to res.download

    fixes #4834
    closes #4855
    mmito authored and dougwilson committed Mar 25, 2022
    Copy the full SHA
    0def9bb View commit details
  2. deps: send@0.18.0

    dougwilson committed Mar 25, 2022
    Copy the full SHA
    dd69eed View commit details
  3. deps: serve-static@1.15.0

    dougwilson committed Mar 25, 2022
    Copy the full SHA
    c924206 View commit details
  4. deps: finalhandler@1.2.0

    dougwilson committed Mar 25, 2022
    Copy the full SHA
    f739b16 View commit details
  5. Copy the full SHA
    03dc367 View commit details
  6. Copy the full SHA
    10b9b50 View commit details

Commits on Mar 26, 2022

  1. Copy the full SHA
    9482b82 View commit details
  2. deps: depd@2.0.0

    closes #4174
    UlisesGascon authored and dougwilson committed Mar 26, 2022
    Copy the full SHA
    1cc8169 View commit details

Commits on Mar 27, 2022

  1. Fix behavior of null/undefined as "maxAge" in res.cookie

    fixes #3935
    closes #3936
    cjbarth authored and dougwilson committed Mar 27, 2022
    Copy the full SHA
    5855339 View commit details

Commits on Mar 28, 2022

  1. Copy the full SHA
    a107702 View commit details

Commits on Apr 3, 2022

  1. deps: body-parser@1.20.0

    dougwilson committed Apr 3, 2022
    Copy the full SHA
    32c558d View commit details
  2. deps: qs@6.10.3

    dougwilson committed Apr 3, 2022
    Copy the full SHA
    1df7576 View commit details
  3. deps: statuses@2.0.1

    closes #4336
    3imed-jaberi authored and dougwilson committed Apr 3, 2022
    Copy the full SHA
    980d881 View commit details
  4. deps: on-finished@2.4.1

    dougwilson committed Apr 3, 2022
    Copy the full SHA
    2e2d78c View commit details

Commits on Apr 7, 2022

  1. Copy the full SHA
    04da4aa View commit details
  2. tests: fix typo in description

    closes #4882
    Hashen110 authored and dougwilson committed Apr 7, 2022
    Copy the full SHA
    1b2e097 View commit details

Commits on Apr 8, 2022

  1. docs: fix typo in casing of HTTP

    closes #4872
    ghousemohamed authored and dougwilson committed Apr 8, 2022
    Copy the full SHA
    99175c3 View commit details

Commits on Apr 11, 2022

  1. Copy the full SHA
    ecaf67c View commit details
  2. Copy the full SHA
    b91c7ff View commit details
  3. examples: add missing html label associations

    closes #4884
    Hashen110 authored and dougwilson committed Apr 11, 2022
    Copy the full SHA
    8880dda View commit details

Commits on Apr 12, 2022

  1. deps: cookie@0.5.0

    dougwilson committed Apr 12, 2022
    Copy the full SHA
    92c5ce5 View commit details

Commits on Apr 14, 2022

  1. Copy the full SHA
    708ac4c View commit details

Commits on Apr 20, 2022

  1. tests: mark stack overflow as long running

    closes #4887
    grisu48 authored and dougwilson committed Apr 20, 2022
    Copy the full SHA
    fd8e45c View commit details

Commits on Apr 21, 2022

  1. Copy the full SHA
    11a209e View commit details
  2. Copy the full SHA
    29ea1b2 View commit details
  3. Copy the full SHA
    158a170 View commit details
Showing with 3,831 additions and 996 deletions.
  1. +158 −129 .github/workflows/ci.yml
  2. +66 −0 .github/workflows/codeql.yml
  3. +69 −0 .github/workflows/iojs.yml
  4. +1 −0 .gitignore
  5. +1 −0 .npmrc
  6. +2 −2 Charter.md
  7. +1 −1 Code-Of-Conduct.md
  8. +124 −28 Contributing.md
  9. +127 −5 History.md
  10. +138 −36 Readme.md
  11. +13 −0 Release-Process.md
  12. +11 −2 Security.md
  13. +9 −2 Triager-Guide.md
  14. +22 −7 appveyor.yml
  15. +12 −8 benchmarks/Makefile
  16. +34 −0 benchmarks/README.md
  17. +1 −1 benchmarks/middleware.js
  18. +5 −3 benchmarks/run
  19. +0 −1 examples/README.md
  20. +4 −4 examples/auth/views/login.ejs
  21. +2 −5 examples/cookie-sessions/index.js
  22. +1 −4 examples/downloads/index.js
  23. +1 −1 examples/error/index.js
  24. +1 −1 examples/markdown/index.js
  25. +0 −62 examples/multipart/index.js
  26. +3 −10 examples/params/index.js
  27. +1 −1 examples/route-separation/views/users/edit.ejs
  28. +2 −2 examples/search/public/index.html
  29. +2 −2 examples/view-locals/index.js
  30. +2 −2 examples/web-service/index.js
  31. +18 −1 lib/application.js
  32. +52 −20 lib/response.js
  33. +21 −16 lib/router/index.js
  34. +22 −8 lib/router/route.js
  35. +3 −3 lib/utils.js
  36. +1 −1 lib/view.js
  37. +20 −22 package.json
  38. +51 −20 test/Route.js
  39. +83 −4 test/Router.js
  40. +2 −3 test/app.listen.js
  41. +14 −18 test/app.locals.js
  42. +3 −3 test/app.param.js
  43. +43 −12 test/app.router.js
  44. +1 −1 test/app.use.js
  45. +44 −0 test/config.js
  46. +10 −11 test/exports.js
  47. +233 −108 test/express.json.js
  48. +185 −18 test/express.raw.js
  49. +2 −2 test/express.static.js
  50. +192 −29 test/express.text.js
  51. +199 −68 test/express.urlencoded.js
  52. +0 −2 test/mocha.opts
  53. +3 −3 test/req.acceptsEncodings.js
  54. +6 −6 test/req.acceptsLanguage.js
  55. +41 −30 test/res.append.js
  56. +32 −0 test/res.clearCookie.js
  57. +118 −0 test/res.cookie.js
  58. +291 −24 test/res.download.js
  59. +30 −3 test/res.format.js
  60. +269 −12 test/res.location.js
  61. +34 −23 test/res.redirect.js
  62. +30 −25 test/res.send.js
  63. +735 −166 test/res.sendFile.js
  64. +193 −12 test/res.status.js
  65. +28 −0 test/support/utils.js
  66. +9 −3 test/utils.js
287 changes: 158 additions & 129 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,161 +1,190 @@
name: ci

on:
- pull_request
- push
push:
branches:
- master
- develop
- '4.x'
- '5.x'
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'

# Cancel in progress workflows
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run
concurrency:
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
test:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js {{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
persist-credentials: false

- name: Install dependencies
run: npm install --ignore-scripts --only=dev

- name: Run lint
run: npm run lint

test:
name: Run tests
strategy:
fail-fast: false
matrix:
name:
- Node.js 0.10
- Node.js 0.12
- io.js 1.x
- io.js 2.x
- io.js 3.x
- Node.js 4.x
- Node.js 5.x
- Node.js 6.x
- Node.js 7.x
- Node.js 8.x
- Node.js 9.x
- Node.js 10.x
- Node.js 11.x
- Node.js 12.x
- Node.js 13.x
- Node.js 14.x

os: [ubuntu-latest, windows-latest]
node-version:
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
- "10"
- "11"
- "12"
- "13"
- "14"
- "15"
- "16"
- "17"
- "18"
- "19"
- "20"
- "21"
- "22"
# Use supported versions of our testing tools under older versions of Node
# Install npm in some specific cases where we need to
include:
- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 0.12
node-version: "0.12"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
- node-version: "0.10"
npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0"
# Npm isn't being installed on windows w/ setup-node for
# 0.10 and 0.12, which will end up choking when npm uses es6
npm-version: "npm@2.15.1"

- name: io.js 1.x
node-version: "1.8"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
- node-version: "0.12"
npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0"
npm-version: "npm@2.15.11"

- name: io.js 2.x
node-version: "2.5"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
- node-version: "4"
npm-i: "mocha@5.2.0 nyc@11.9.0 supertest@3.4.2"

- name: io.js 3.x
node-version: "3.3"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
- node-version: "5"
npm-i: "mocha@5.2.0 nyc@11.9.0 supertest@3.4.2"
# fixes https://github.com/npm/cli/issues/681
npm-version: "npm@3.10.10"

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
- node-version: "6"
npm-i: "mocha@6.2.2 nyc@14.1.1 supertest@3.4.2"

- name: Node.js 5.x
node-version: "5.12"
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
- node-version: "7"
npm-i: "mocha@6.2.2 nyc@14.1.1 supertest@6.1.6"

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6
- node-version: "8"
npm-i: "mocha@7.2.0 nyc@14.1.1"

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.2 nyc@14.1.1 supertest@6.1.6
- node-version: "9"
npm-i: "mocha@7.2.0 nyc@14.1.1"

- name: Node.js 8.x
node-version: "8.17"
npm-i: mocha@7.2.0
- node-version: "10"
npm-i: "mocha@8.4.0"

- name: Node.js 9.x
node-version: "9.11"
npm-i: mocha@7.2.0
- node-version: "11"
npm-i: "mocha@8.4.0"

- name: Node.js 10.x
node-version: "10.24"
npm-i: mocha@8.4.0
- node-version: "12"
npm-i: "mocha@9.2.2"

- name: Node.js 11.x
node-version: "11.15"
npm-i: mocha@8.4.0

- name: Node.js 12.x
node-version: "12.22"

- name: Node.js 13.x
node-version: "13.14"

- name: Node.js 14.x
node-version: "14.19"
- node-version: "13"
npm-i: "mocha@9.2.2"

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install Node.js ${{ matrix.node-version }}
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Npm version fixes
if: ${{matrix.npm-version != ''}}
run: npm install -g ${{ matrix.npm-version }}

- name: Configure npm loglevel
run: |
npm config set loglevel error
shell: bash

- name: Install dependencies
run: npm install

- name: Install Node version specific dev deps
if: ${{ matrix.npm-i != '' }}
run: npm install --save-dev ${{ matrix.npm-i }}

- name: Remove non-test dependencies
run: npm rm --silent --save-dev connect-redis

- name: Output Node and NPM versions
run: |
echo "Node.js version: $(node -v)"
echo "NPM version: $(npm -v)"
- name: Run tests
shell: bash
run: |
npm run test-ci
cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
- name: Collect code coverage
run: |
mv ./coverage "./${{ matrix.node-version }}"
mkdir ./coverage
mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
- name: Upload code coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./coverage
retention-days: 1

- name: Configure npm
run: |
npm config set loglevel error
npm config set shrinkwrap false
- name: Install npm module(s) ${{ matrix.npm-i }}
run: npm install --save-dev ${{ matrix.npm-i }}
if: matrix.npm-i != ''

- name: Remove non-test dependencies
run: npm rm --silent --save-dev connect-redis
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js version-specific dependencies
shell: bash
run: |
# eslint for linting
# - remove on Node.js < 10
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
grep -E '^eslint(-|$)' | \
sort -r | \
xargs -n1 npm rm --silent --save-dev
fi
- name: Install Node.js dependencies
run: npm install

- name: List environment
id: list_env
- name: Install lcov
shell: bash
run: |
echo "node@$(node -v)"
echo "npm@$(npm -v)"
npm -s ls ||:
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'
run: sudo apt-get -y install lcov

- name: Run tests
shell: bash
run: npm run test-ci
- name: Collect coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
path: ./coverage

- name: Lint code
if: steps.list_env.outputs.eslint != ''
run: npm run lint
- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info

- name: Collect code coverage
- name: Upload coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.test_number }}
parallel: true

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Upload code coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
66 changes: 66 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
with:
languages: javascript
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
with:
category: "/language:javascript"
Loading