Compare commits

...

32 Commits

Author SHA1 Message Date
kgarg1
b8ab46594d
test: add coverage for app.listen() variants (#6476)
Some checks failed
ci / Lint (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (18, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (18, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (19, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (19, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (20, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (20, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (21, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (21, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (22, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (22, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (23, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (23, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (24, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (24, windows-latest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (16, ubuntu-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (16, windows-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (17, ubuntu-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (17, windows-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
ci / coverage (push) Has been cancelled
legacy / coverage (push) Has been cancelled
* test: add coverage for app.listen() variants

- verify alternate signatures (port+host+backlog)
- verify server.address() shape

* fix linter issue

---------

Co-authored-by: kuldeep <kuldeep@wanclouds.net>
2025-05-28 19:26:16 -05:00
Shivam Sharma
fedd60e642
ci: allow manual triggering of workflow (#6515) 2025-05-28 19:16:44 -05:00
Mert Şişmanoğlu
99a0bd3354
ci: disable credential persistence for checkout actions (#6522)
Signed-off-by: Mert Şişmanoğlu <mertssmnoglu@gmail.com>
2025-05-28 18:55:05 -05:00
Noritaka Kobayashi
dfd1851245
test: fix typos in test descriptions (#6535) 2025-05-27 10:36:50 +02:00
Jon Church
9f4dbe3a13
chore: wider range for query test skip (#6512) 2025-05-15 11:40:26 -05:00
Phillip Barta
9784321e89
ci: update codeql config (#6488) 2025-05-09 15:29:27 +02:00
Phillip Barta
ee1ef41bd3
ci: add node.js 24 to test matrix (#6504) 2025-05-07 21:08:25 -05:00
dependabot[bot]
1ca803dd55
build(deps): bump actions/download-artifact from 4.2.1 to 4.3.0 (#6496)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](95815c38cf...d3f86a106a)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 23:02:23 +02:00
dependabot[bot]
73555815b9
build(deps): bump actions/setup-node from 4.3.0 to 4.4.0 (#6497)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](cdca7365b2...49933ea528)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 23:02:09 +02:00
dependabot[bot]
a1161b4686
build(deps): bump github/codeql-action from 3.28.13 to 3.28.16 (#6498)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.16.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b549b9259...28deaeda66)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 23:01:58 +02:00
dufucun
f9954dd317
fix(test): remove duplicate word (#6456)
Signed-off-by: dufucun <dufuchun@sohu.com>
2025-04-16 11:18:38 -05:00
Ashish Sharma
5da5a11a49
increased code coverage of utils.js file (#6386)
Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
2025-04-10 20:57:43 -05:00
Ayoub Mabrouk
3dc96995df
Refactor: simplify acceptsLanguages implementation using spread operator (#6137)
Refactored `req.acceptsLanguages` to use the spread operator for passing arguments directly to `accept.languages`, eliminating the need for `.apply`. This approach improves readability and streamlines the function call.
2025-04-10 20:49:23 -05:00
dependabot[bot]
fa40ecfe76
build(deps): bump github/codeql-action from 3.28.11 to 3.28.13 (#6429) 2025-04-04 21:53:14 -05:00
Wes Todd
cd7d4397c3 5.1.0 2025-03-28 13:29:16 -05:00
Ulises Gascón
4c4f3ea105
fix(deps): serve-static@^2.2.0 (#6418)
* Update package.json

* Update History.md

---------

Co-authored-by: Wes Todd <wes@wesleytodd.com>
2025-03-27 19:46:06 -05:00
Mert Can Altin
cb4c56e9a7
fix(docs): remove @mertcanaltin from Triagers (#6408)
* doc: remove @mertcanaltin from Triagers

* move emeritus

---------

Co-authored-by: Mert Can Altin <mert.altin@trendyol.com>
Co-authored-by: Wes Todd <wes@wesleytodd.com>
2025-03-27 18:43:18 -05:00
Phillip9587
7b44e1d850 ci: use full SHAs for github action versions
Ref: https://github.com/expressjs/security-wg/issues/2
2025-03-27 15:46:29 +01:00
Ulises Gascón
eb6d12587a
deps: router@^2.2.0 (#6417) 2025-03-27 02:47:40 +01:00
Ulises Gascón
f1a2dc884d
deps: type-is@^2.0.1 (#6420) 2025-03-27 02:32:28 +01:00
Ulises Gascón
6b51e8ef97
deps: body-parser@^2.2.0 (#6419) 2025-03-27 02:31:57 +01:00
dependabot[bot]
1f311c59d4
build(deps-dev): bump cookie-session from 2.0.0 to 2.1.0 (#6399)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-23 20:08:24 -05:00
Wes Todd
9e97144222
feat(deps): finalhandler@2.1.0 (#6373)
* feat(deps): finalhandler@2.1.0

* Update History.md

Co-authored-by: Phillip Barta <barta.phillip@gmail.com>

---------

Co-authored-by: Phillip Barta <barta.phillip@gmail.com>
Co-authored-by: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-03-18 19:12:45 -05:00
dependabot[bot]
29d09803c1
build(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1 (#6397)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](62b2cac7ed...f49aabe0b5)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 17:12:20 +01:00
dependabot[bot]
1d63162dbf
build(deps): bump github/codeql-action from 3.24.7 to 3.28.11 (#6398)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.7 to 3.28.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.7...6bb031afdd8eb862ea3fc1848194185e076637e5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 17:11:59 +01:00
Sebastian Beltran
4a2175dfc9
fix dependabot config (#6392) 2025-03-16 17:44:57 -05:00
Ulises Gascón
0bb00e1906
ci: add dependabot (#5435)
Co-authored-by: Shivam Sharma <meshivam81@gmail.com>
Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
2025-03-11 22:50:59 +01:00
Wes Todd
1e359f57fc
fix(deps): qs@^6.14.0 (#6374) 2025-03-11 22:49:58 +01:00
Ulises Gascón
9cbe2c2cbb
docs: add @dpopp07 to the triage team (#6352) 2025-03-11 22:49:08 +01:00
Sebastian Beltran
35e15362ab
fix(docs): clarify guidelines for becoming a committer (#6364)
* docs: clarify guidelines for becoming a committer

* Update Contributing.md

Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>

---------

Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>
2025-03-05 09:11:29 -06:00
Sebastian Beltran
90e522ac90
fix(docs): update guidance for triager nominations (#6349)
* docs: update guidance for triager nominations

* Update Contributing.md

Co-authored-by: Wes Todd <wes@wesleytodd.com>

* Update Contributing.md

---------

Co-authored-by: Wes Todd <wes@wesleytodd.com>
2025-03-04 08:09:18 -06:00
Ulises Gascón
59703c2321
docs: update emeritus triagers (#6345) 2025-02-27 22:47:13 +01:00
21 changed files with 167 additions and 95 deletions

17
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
time: "23:00"
timezone: Europe/London
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

View File

@ -13,6 +13,7 @@ on:
pull_request:
paths-ignore:
- '*.md'
workflow_dispatch:
permissions:
contents: read
@ -28,9 +29,11 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 'lts/*'
@ -45,19 +48,19 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18, 19, 20, 21, 22, 23]
node-version: [18, 19, 20, 21, 22, 23, 24]
# 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
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
@ -79,7 +82,7 @@ jobs:
run: npm run test-ci
- name: Upload code coverage
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
path: ./coverage/lcov.info
@ -92,14 +95,16 @@ jobs:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov
- name: Collect coverage reports
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ./coverage
pattern: coverage-node-*
@ -109,6 +114,6 @@ jobs:
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
- name: Upload coverage report
uses: coverallsapp/github-action@v2
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
file: ./lcov.info

View File

@ -19,6 +19,7 @@ on:
branches: ["master"]
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
permissions:
contents: read
@ -31,16 +32,25 @@ jobs:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [javascript, actions]
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
with:
languages: javascript
languages: ${{ matrix.language }}
config: |
paths-ignore:
- test
# 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.
@ -61,6 +71,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
with:
category: "/language:javascript"
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16

View File

@ -13,7 +13,8 @@ on:
pull_request:
paths-ignore:
- '*.md'
workflow_dispatch:
permissions:
contents: read
@ -36,12 +37,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
@ -63,7 +64,7 @@ jobs:
run: npm run test-ci
- name: Upload code coverage
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}
path: ./coverage/lcov.info
@ -76,14 +77,16 @@ jobs:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov
- name: Collect coverage reports
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ./coverage
pattern: coverage-node-*
@ -93,6 +96,6 @@ jobs:
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
- name: Upload coverage report
uses: coverallsapp/github-action@v2
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
file: ./lcov.info

View File

@ -37,7 +37,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
@ -67,6 +67,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
with:
sarif_file: results.sarif
sarif_file: results.sarif

View File

@ -67,14 +67,15 @@ Currently, any existing [organization member](https://github.com/orgs/expressjs/
a new triager. If you are interested in becoming a triager, our best advice is to actively participate
in the community by helping triaging issues and pull requests. As well we recommend
to engage in other community activities like attending the TC meetings, and participating in the Slack
discussions.
discussions. If you feel ready and have been helping triage some issues, reach out to an active member of the organization to ask if they'd
be willing to support you. If they agree, they can create a pull request to formalize your nomination. In the case of an objection to the nomination, the triage team is responsible for working with the individuals involved and finding a resolution.
You can also reach out to any of the [organization members](https://github.com/orgs/expressjs/people)
if you have questions or need guidance.
## Becoming a Committer
All contributors who land a non-trivial contribution should be on-boarded in a timely manner,
All contributors who have landed significant and valuable contributions should be onboarded in a timely manner,
and added as a committer, and be given write access to the repository.
Committers are expected to follow this policy and continue to send pull requests, go through

View File

@ -1,28 +1,25 @@
unreleased
5.1.0 / 2025-03-31
========================
* Remove `utils-merge` dependency - use spread syntax instead
* Remove `Object.setPrototypeOf` polyfill
* cleanup: remove AsyncLocalStorage check from tests
* cleanup: remove unnecessary require for global Buffer
* Add support for `Uint8Array` in `res.send()`
* Add support for ETag option in `res.sendFile()`
* Add support for multiple links with the same rel in `res.links()`
* Add funding field to package.json
* perf: use loop for acceptParams
* Replace `methods` dependency with standard library
* refactor: prefix built-in node module imports
* Remove unused `depd` dependency
* Add support for `Uint8Array` in `res.send`
* Add support for ETag option in res.sendFile
* Extend res.links() to allow adding multiple links with the same rel
* deps: debug@^4.4.0
* deps: body-parser@^2.1.0
* deps: router@^2.1.0
* deps: nyc@^17.1.0
* deps: mocha@^10.7.3
* deps: marked@^15.0.3
* deps: express-session@^1.18.1
* deps: ejs@^3.1.10
* deps: content-type@^1.0.5
* deps: connect-redis@^8.0.1
* deps: supertest@^6.3.4
* deps: remove `setprototypeof`
* deps: remove `safe-buffer`
* deps: remove `utils-merge`
* deps: remove `methods`
* deps: remove `depd`
* deps: `debug@^4.4.0`
* deps: `body-parser@^2.2.0`
* deps: `router@^2.2.0`
* deps: `content-type@^1.0.5`
* deps: `finalhandler@^2.1.0`
* deps: `qs@^6.14.0`
* deps: `server-static@2.2.0`
* deps: `type-is@2.0.1`
5.0.1 / 2024-10-08
==========

View File

@ -200,14 +200,9 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj)
* [bjohansebas](https://github.com/bjohansebas) - **Sebastian Beltran**
* [carpasse](https://github.com/carpasse) - **Carlos Serrano**
* [CBID2](https://github.com/CBID2) - **Christine Belzie**
* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**
* [dpopp07](https://github.com/dpopp07) - **Dustin Popp**
* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him)
* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**
* [0ss](https://github.com/0ss) - **Salah**
* [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him)
* [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi**
* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)
* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**
* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him)
* [Phillip9587](https://github.com/Phillip9587) - **Phillip Barta**
* [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger**
@ -244,6 +239,13 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj)
* [sheplu](https://github.com/sheplu) - **Jean Burellier**
* [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav**
* [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe**
* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim**
* [0ss](https://github.com/0ss) - **Salah**
* [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him)
* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him)
* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego**
* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin**
</details>

View File

@ -169,9 +169,8 @@ req.acceptsCharsets = function(){
* @public
*/
req.acceptsLanguages = function(){
var accept = accepts(this);
return accept.languages.apply(accept, arguments);
req.acceptsLanguages = function(...languages) {
return accepts(this).languages(...languages);
};
/**

View File

@ -1,7 +1,7 @@
{
"name": "express",
"description": "Fast, unopinionated, minimalist web framework",
"version": "5.0.1",
"version": "5.1.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"contributors": [
"Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@ -33,7 +33,7 @@
],
"dependencies": {
"accepts": "^2.0.0",
"body-parser": "^2.1.0",
"body-parser": "^2.2.0",
"content-disposition": "^1.0.0",
"content-type": "^1.0.5",
"cookie": "^0.7.1",
@ -42,7 +42,7 @@
"encodeurl": "^2.0.0",
"escape-html": "^1.0.3",
"etag": "^1.8.1",
"finalhandler": "^2.0.0",
"finalhandler": "^2.1.0",
"fresh": "^2.0.0",
"http-errors": "^2.0.0",
"merge-descriptors": "^2.0.0",
@ -51,20 +51,20 @@
"once": "^1.4.0",
"parseurl": "^1.3.3",
"proxy-addr": "^2.0.7",
"qs": "^6.13.0",
"qs": "^6.14.0",
"range-parser": "^1.2.1",
"router": "^2.1.0",
"router": "^2.2.0",
"send": "^1.1.0",
"serve-static": "^2.1.0",
"serve-static": "^2.2.0",
"statuses": "^2.0.1",
"type-is": "^2.0.0",
"type-is": "^2.0.1",
"vary": "^1.1.2"
},
"devDependencies": {
"after": "0.8.2",
"connect-redis": "^8.0.1",
"cookie-parser": "1.4.7",
"cookie-session": "2.0.0",
"cookie-session": "2.1.0",
"ejs": "^3.1.10",
"eslint": "8.47.0",
"express-session": "^1.18.1",

View File

@ -24,4 +24,32 @@ describe('app.listen()', function(){
})
})
})
it('accepts port + hostname + backlog + callback', function (done) {
const app = express();
const server = app.listen(0, '127.0.0.1', 5, function () {
const { address, port } = server.address();
assert.strictEqual(address, '127.0.0.1');
assert(Number.isInteger(port) && port > 0);
// backlog isnt directly inspectable, but if no error was thrown
// we know it was accepted.
server.close(done);
});
});
it('accepts just a callback (no args)', function (done) {
const app = express();
// same as app.listen(0, done)
const server = app.listen();
server.close(done);
});
it('server.address() gives a { address, port, family } object', function (done) {
const app = express();
const server = app.listen(0, () => {
const addr = server.address();
assert(addr && typeof addr === 'object');
assert.strictEqual(typeof addr.address, 'string');
assert(Number.isInteger(addr.port) && addr.port > 0);
assert(typeof addr.family === 'string');
server.close(done);
});
});
})

View File

@ -1156,7 +1156,7 @@ describe('app.router', function () {
assert.strictEqual(app.get('/', function () { }), app)
})
it('should should not use disposed router/middleware', function (done) {
it('should not use disposed router/middleware', function (done) {
// more context: https://github.com/expressjs/express/issues/5743#issuecomment-2277148412
var app = express();

View File

@ -539,7 +539,7 @@ describe('express.json()', function () {
this.app = app
})
it('should presist store', function (done) {
it('should persist store', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/json')
@ -561,7 +561,7 @@ describe('express.json()', function () {
.end(done)
})
it('should presist store when inflated', function (done) {
it('should persist store when inflated', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/json')
@ -572,7 +572,7 @@ describe('express.json()', function () {
test.end(done)
})
it('should presist store when inflate error', function (done) {
it('should persist store when inflate error', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/json')
@ -582,7 +582,7 @@ describe('express.json()', function () {
test.end(done)
})
it('should presist store when parse error', function (done) {
it('should persist store when parse error', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/json')
@ -592,7 +592,7 @@ describe('express.json()', function () {
.end(done)
})
it('should presist store when limit exceeded', function (done) {
it('should persist store when limit exceeded', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/json')

View File

@ -368,7 +368,7 @@ describe('express.raw()', function () {
this.app = app
})
it('should presist store', function (done) {
it('should persist store', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/octet-stream')
@ -379,7 +379,7 @@ describe('express.raw()', function () {
.end(done)
})
it('should presist store when unmatched content-type', function (done) {
it('should persist store when unmatched content-type', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/fizzbuzz')
@ -389,7 +389,7 @@ describe('express.raw()', function () {
.end(done)
})
it('should presist store when inflated', function (done) {
it('should persist store when inflated', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/octet-stream')
@ -400,7 +400,7 @@ describe('express.raw()', function () {
test.end(done)
})
it('should presist store when inflate error', function (done) {
it('should persist store when inflate error', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/octet-stream')
@ -410,7 +410,7 @@ describe('express.raw()', function () {
test.end(done)
})
it('should presist store when limit exceeded', function (done) {
it('should persist store when limit exceeded', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/octet-stream')

View File

@ -397,7 +397,7 @@ describe('express.text()', function () {
this.app = app
})
it('should presist store', function (done) {
it('should persist store', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'text/plain')
@ -408,7 +408,7 @@ describe('express.text()', function () {
.end(done)
})
it('should presist store when unmatched content-type', function (done) {
it('should persist store when unmatched content-type', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/fizzbuzz')
@ -418,7 +418,7 @@ describe('express.text()', function () {
.end(done)
})
it('should presist store when inflated', function (done) {
it('should persist store when inflated', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'text/plain')
@ -429,7 +429,7 @@ describe('express.text()', function () {
test.end(done)
})
it('should presist store when inflate error', function (done) {
it('should persist store when inflate error', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'text/plain')
@ -439,7 +439,7 @@ describe('express.text()', function () {
test.end(done)
})
it('should presist store when limit exceeded', function (done) {
it('should persist store when limit exceeded', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'text/plain')

View File

@ -642,7 +642,7 @@ describe('express.urlencoded()', function () {
this.app = app
})
it('should presist store', function (done) {
it('should persist store', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')
@ -653,7 +653,7 @@ describe('express.urlencoded()', function () {
.end(done)
})
it('should presist store when unmatched content-type', function (done) {
it('should persist store when unmatched content-type', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/fizzbuzz')
@ -663,7 +663,7 @@ describe('express.urlencoded()', function () {
.end(done)
})
it('should presist store when inflated', function (done) {
it('should persist store when inflated', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/x-www-form-urlencoded')
@ -674,7 +674,7 @@ describe('express.urlencoded()', function () {
test.end(done)
})
it('should presist store when inflate error', function (done) {
it('should persist store when inflate error', function (done) {
var test = request(this.app).post('/')
test.set('Content-Encoding', 'gzip')
test.set('Content-Type', 'application/x-www-form-urlencoded')
@ -684,7 +684,7 @@ describe('express.urlencoded()', function () {
test.end(done)
})
it('should presist store when limit exceeded', function (done) {
it('should persist store when limit exceeded', function (done) {
request(this.app)
.post('/')
.set('Content-Type', 'application/x-www-form-urlencoded')

View File

@ -88,7 +88,7 @@ describe('res', function(){
})
describe('async local storage', function () {
it('should presist store', function (done) {
it('should persist store', function (done) {
var app = express()
var cb = after(2, done)
var store = { foo: 'bar' }
@ -116,7 +116,7 @@ describe('res', function(){
.expect(200, 'tobi', cb)
})
it('should presist store on error', function (done) {
it('should persist store on error', function (done) {
var app = express()
var store = { foo: 'bar' }

View File

@ -237,7 +237,7 @@ function test(app) {
})
describe('when no match is made', function(){
it('should should respond with 406 not acceptable', function(done){
it('should respond with 406 not acceptable', function(done){
request(app)
.get('/')
.set('Accept', 'foo/bar')

View File

@ -277,7 +277,7 @@ describe('res', function(){
})
describe('async local storage', function () {
it('should presist store', function (done) {
it('should persist store', function (done) {
var app = express()
var cb = after(2, done)
var store = { foo: 'bar' }
@ -304,7 +304,7 @@ describe('res', function(){
.expect(200, 'tobi', cb)
})
it('should presist store on error', function (done) {
it('should persist store on error', function (done) {
var app = express()
var store = { foo: 'bar' }

View File

@ -76,10 +76,10 @@ function getMajorVersion(versionString) {
}
function shouldSkipQuery(versionString) {
// Skipping HTTP QUERY tests on Node 21, it is reported in http.METHODS on 21.7.2 but not supported
// update this implementation to run on supported versions of 21 once they exist
// Skipping HTTP QUERY tests below Node 22, QUERY wasn't fully supported by Node until 22
// we could update this implementation to run on supported versions of 21 once they exist
// upstream tracking https://github.com/nodejs/node/issues/51562
// express tracking issue: https://github.com/expressjs/express/issues/5615
return Number(getMajorVersion(versionString)) === 21
return Number(getMajorVersion(versionString)) < 22
}

View File

@ -25,6 +25,18 @@ describe('utils.etag(body, encoding)', function(){
})
})
describe('utils.normalizeType acceptParams method', () => {
it('should handle a type with a malformed parameter and break the loop in acceptParams', () => {
const result = utils.normalizeType('text/plain;invalid');
assert.deepEqual(result,{
value: 'text/plain',
quality: 1,
params: {} // No parameters are added since "invalid" has no "="
});
});
});
describe('utils.setCharset(type, charset)', function () {
it('should do anything without type', function () {
assert.strictEqual(utils.setCharset(), undefined);