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: 4.21.2
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.0
Choose a head ref
Loading
Showing with 1,122 additions and 3,420 deletions.
  1. +3 −1 .eslintrc.yml
  2. +5 −78 .github/workflows/ci.yml
  3. +0 −69 .github/workflows/iojs.yml
  4. +100 −0 .github/workflows/legacy.yml
  5. +196 −0 History.md
  6. +0 −113 appveyor.yml
  7. +3 −2 examples/auth/index.js
  8. +8 −4 examples/cookies/index.js
  9. +2 −2 examples/downloads/index.js
  10. +1 −1 examples/resource/index.js
  11. +1 −1 examples/route-separation/index.js
  12. +1 −1 examples/route-separation/user.js
  13. +2 −2 examples/search/index.js
  14. +59 −78 lib/application.js
  15. +2 −37 lib/express.js
  16. +0 −43 lib/middleware/init.js
  17. +0 −47 lib/middleware/query.js
  18. +38 −48 lib/request.js
  19. +39 −190 lib/response.js
  20. +0 −673 lib/router/index.js
  21. +0 −181 lib/router/layer.js
  22. +0 −230 lib/router/route.js
  23. +2 −54 lib/utils.js
  24. +24 −1 lib/view.js
  25. +17 −16 package.json
  26. +25 −29 test/Router.js
  27. +1 −1 test/app.all.js
  28. +0 −18 test/app.del.js
  29. +0 −12 test/app.js
  30. +14 −0 test/app.listen.js
  31. +2 −1 test/app.locals.js
  32. +10 −10 test/app.options.js
  33. +0 −42 test/app.param.js
  34. +135 −0 test/app.route.js
  35. +228 −202 test/app.router.js
  36. +1 −1 test/app.routes.error.js
  37. +5 −5 test/app.use.js
  38. +0 −5 test/exports.js
  39. +7 −31 test/express.json.js
  40. +2 −33 test/express.raw.js
  41. +1 −1 test/express.static.js
  42. +2 −29 test/express.text.js
  43. +4 −31 test/express.urlencoded.js
  44. +0 −50 test/req.acceptsCharset.js
  45. +0 −39 test/req.acceptsEncoding.js
  46. +0 −57 test/req.acceptsLanguage.js
  47. +20 −0 test/req.fresh.js
  48. +2 −2 test/req.host.js
  49. +0 −61 test/req.param.js
  50. +2 −19 test/req.query.js
  51. +2 −2 test/req.route.js
  52. +6 −12 test/res.clearCookie.js
  53. +6 −6 test/res.download.js
  54. +10 −5 test/res.format.js
  55. +0 −43 test/res.json.js
  56. +0 −43 test/res.jsonp.js
  57. +8 −54 test/res.location.js
  58. +0 −15 test/res.redirect.js
  59. +6 −51 test/res.send.js
  60. +2 −503 test/res.sendFile.js
  61. +12 −0 test/res.sendStatus.js
  62. +103 −99 test/res.status.js
  63. +1 −1 test/res.type.js
  64. +2 −3 test/res.vary.js
  65. +0 −32 test/utils.js
4 changes: 3 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
root: true

env:
es2022: true
node: true
rules:
eol-last: error
eqeqeq: [error, allow-null]
83 changes: 5 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ on:
- develop
- '4.x'
- '5.x'
- '5.0'
paths-ignore:
- '*.md'
pull_request:
@@ -38,77 +39,14 @@ jobs:
run: npm run lint

test:
name: Run tests
strategy:
fail-fast: false
matrix:
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:
- 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"

- node-version: "0.12"
npm-i: "mocha@3.5.3 nyc@10.3.2 supertest@2.0.0"
npm-version: "npm@2.15.11"

- node-version: "4"
npm-i: "mocha@5.2.0 nyc@11.9.0 supertest@3.4.2"

- 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"

- node-version: "6"
npm-i: "mocha@6.2.2 nyc@14.1.1 supertest@3.4.2"

- node-version: "7"
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"

- node-version: "9"
npm-i: "mocha@7.2.0 nyc@14.1.1"

- node-version: "10"
npm-i: "mocha@8.4.0"

- node-version: "11"
npm-i: "mocha@8.4.0"

- node-version: "12"
npm-i: "mocha@9.2.2"

- node-version: "13"
npm-i: "mocha@9.2.2"
node-version: [18, 19, 20, 21, 22]
# Node.js release schedule: https://nodejs.org/en/about/releases/

name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}

runs-on: ${{ matrix.os }}
steps:
@@ -121,10 +59,6 @@ jobs:
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
@@ -133,13 +67,6 @@ jobs:
- 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)"
69 changes: 0 additions & 69 deletions .github/workflows/iojs.yml

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: legacy

on:
push:
branches:
- master
- develop
- '4.x'
- '5.x'
- '5.0'
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:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [16, 17]
# Node.js release schedule: https://nodejs.org/en/about/releases/

name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}

runs-on: ${{ matrix.os }}
steps:
- 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: Configure npm loglevel
run: |
npm config set loglevel error
shell: bash

- name: Install dependencies
run: npm install

- 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

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
path: ./coverage

- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Loading