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: e1b45ebd050b6f06aa38cda5aaf0c21708b0c71e
Choose a base ref
...
head repository: expressjs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d854c43ea177d1faeea56189249fff8c24a764bd
Choose a head ref
Loading
Showing with 4,342 additions and 1,228 deletions.
  1. +1 −1 .eslintrc.yml
  2. +177 −0 .github/workflows/ci.yml
  3. +4 −16 .gitignore
  4. +0 −66 .travis.yml
  5. +92 −0 Charter.md
  6. +139 −0 Code-Of-Conduct.md
  7. +2 −1 Collaborator-Guide.md
  8. +35 −7 Contributing.md
  9. +102 −0 History.md
  10. +43 −32 Readme.md
  11. +5 −2 Security.md
  12. +63 −0 Triager-Guide.md
  13. +48 −10 appveyor.yml
  14. +12 −8 benchmarks/Makefile
  15. +1 −1 benchmarks/middleware.js
  16. +5 −3 benchmarks/run
  17. +30 −0 examples/README.md
  18. +6 −3 examples/auth/index.js
  19. +2 −0 examples/auth/views/head.ejs
  20. +6 −7 examples/auth/views/login.ejs
  21. +2 −0 examples/content-negotiation/db.js
  22. +2 −0 examples/content-negotiation/index.js
  23. +1 −0 examples/content-negotiation/users.js
  24. +2 −0 examples/cookie-sessions/index.js
  25. +2 −0 examples/cookies/index.js
  26. +3 −0 examples/downloads/files/notes/groceries.txt
  27. +13 −8 examples/downloads/index.js
  28. +2 −0 examples/ejs/index.js
  29. +1 −1 examples/ejs/public/stylesheets/style.css
  30. +1 −0 examples/ejs/views/header.html
  31. +2 −2 examples/ejs/views/users.html
  32. +2 −0 examples/error-pages/index.js
  33. +2 −2 examples/error-pages/views/404.ejs
  34. +2 −2 examples/error-pages/views/500.ejs
  35. +2 −0 examples/error-pages/views/error_header.ejs
  36. +2 −0 examples/error-pages/views/index.ejs
  37. +2 −0 examples/error/index.js
  38. +3 −1 examples/hello-world/index.js
  39. +2 −0 examples/markdown/index.js
  40. +2 −0 examples/multi-router/controllers/api_v1.js
  41. +2 −0 examples/multi-router/controllers/api_v2.js
  42. +2 −0 examples/multi-router/index.js
  43. +2 −0 examples/multipart/index.js
  44. +2 −0 examples/mvc/controllers/main/index.js
  45. +2 −0 examples/mvc/controllers/pet/index.js
  46. +2 −0 examples/mvc/controllers/pet/views/edit.ejs
  47. +2 −0 examples/mvc/controllers/pet/views/show.ejs
  48. +2 −0 examples/mvc/controllers/user-pet/index.js
  49. +2 −0 examples/mvc/controllers/user/index.js
  50. +2 −0 examples/mvc/controllers/user/views/edit.hbs
  51. +2 −0 examples/mvc/controllers/user/views/list.hbs
  52. +2 −0 examples/mvc/controllers/user/views/show.hbs
  53. +2 −0 examples/mvc/db.js
  54. +2 −0 examples/mvc/index.js
  55. +2 −0 examples/mvc/lib/boot.js
  56. +1 −0 examples/mvc/views/404.ejs
  57. +1 −0 examples/mvc/views/5xx.ejs
  58. +1 −0 examples/online/index.js
  59. +4 −9 examples/params/index.js
  60. +3 −1 examples/resource/index.js
  61. +6 −3 examples/route-map/index.js
  62. +3 −1 examples/route-middleware/index.js
  63. +2 −0 examples/route-separation/index.js
  64. +2 −0 examples/route-separation/post.js
  65. +2 −0 examples/route-separation/site.js
  66. +2 −0 examples/route-separation/user.js
  67. +1 −0 examples/route-separation/views/header.ejs
  68. +2 −2 examples/route-separation/views/index.ejs
  69. +2 −2 examples/route-separation/views/posts/index.ejs
  70. +3 −3 examples/route-separation/views/users/edit.ejs
  71. +2 −2 examples/route-separation/views/users/index.ejs
  72. +2 −2 examples/route-separation/views/users/view.ejs
  73. +1 −0 examples/search/index.js
  74. +2 −0 examples/search/public/client.js
  75. +3 −2 examples/search/public/index.html
  76. +1 −0 examples/session/index.js
  77. +2 −0 examples/session/redis.js
  78. +2 −0 examples/static-files/index.js
  79. +2 −0 examples/vhost/index.js
  80. +2 −0 examples/view-constructor/github-view.js
  81. +2 −0 examples/view-constructor/index.js
  82. +2 −0 examples/view-locals/index.js
  83. +2 −0 examples/view-locals/user.js
  84. +1 −0 examples/view-locals/views/index.ejs
  85. +6 −4 examples/web-service/index.js
  86. +19 −2 lib/application.js
  87. +1 −1 lib/request.js
  88. +57 −30 lib/response.js
  89. +25 −14 lib/router/index.js
  90. +9 −0 lib/router/route.js
  91. +5 −7 lib/utils.js
  92. +1 −1 lib/view.js
  93. +32 −31 package.json
  94. +40 −17 test/Route.js
  95. +38 −3 test/Router.js
  96. +16 −1 test/acceptance/auth.js
  97. +1 −1 test/acceptance/cookie-sessions.js
  98. +17 −0 test/acceptance/downloads.js
  99. +21 −0 test/acceptance/hello-world.js
  100. +3 −3 test/acceptance/web-service.js
  101. +8 −5 test/app.all.js
  102. +1 −0 test/app.del.js
  103. +8 −6 test/app.engine.js
  104. +8 −10 test/app.head.js
  105. +40 −18 test/app.js
  106. +1 −4 test/app.listen.js
  107. +16 −17 test/app.locals.js
  108. +1 −0 test/app.options.js
  109. +16 −17 test/app.param.js
  110. +28 −27 test/app.render.js
  111. +120 −0 test/app.request.js
  112. +114 −15 test/app.response.js
  113. +2 −0 test/app.route.js
  114. +50 −17 test/app.router.js
  115. +9 −6 test/app.routes.error.js
  116. +11 −9 test/app.use.js
  117. +45 −0 test/config.js
  118. +11 −11 test/exports.js
  119. +233 −107 test/express.json.js
  120. +186 −18 test/express.raw.js
  121. +3 −2 test/express.static.js
  122. +193 −29 test/express.text.js
  123. +198 −66 test/express.urlencoded.js
  124. +1 −0 test/middleware.basic.js
  125. +0 −2 test/mocha.opts
  126. +1 −0 test/regression.js
  127. +1 −0 test/req.accepts.js
  128. +1 −0 test/req.acceptsCharset.js
  129. +1 −0 test/req.acceptsCharsets.js
  130. +19 −16 test/req.acceptsEncoding.js
  131. +19 −16 test/req.acceptsEncodings.js
  132. +29 −25 test/req.acceptsLanguage.js
  133. +29 −25 test/req.acceptsLanguages.js
  134. +1 −0 test/req.baseUrl.js
  135. +1 −0 test/req.fresh.js
  136. +1 −0 test/req.get.js
  137. +1 −0 test/req.host.js
  138. +1 −0 test/req.hostname.js
  139. +17 −1 test/req.ip.js
  140. +1 −0 test/req.ips.js
  141. +1 −0 test/req.is.js
  142. +1 −0 test/req.param.js
  143. +1 −0 test/req.path.js
  144. +1 −0 test/req.protocol.js
  145. +4 −1 test/req.query.js
  146. +1 −0 test/req.range.js
  147. +7 −4 test/req.route.js
  148. +1 −0 test/req.secure.js
  149. +1 −0 test/req.signedCookies.js
  150. +1 −0 test/req.stale.js
  151. +1 −0 test/req.subdomains.js
  152. +23 −43 test/req.xhr.js
  153. +42 −30 test/res.append.js
  154. +1 −0 test/res.attachment.js
  155. +1 −0 test/res.clearCookie.js
  156. +125 −19 test/res.cookie.js
  157. +320 −25 test/res.download.js
  158. +29 −1 test/res.format.js
  159. +1 −0 test/res.get.js
  160. +16 −0 test/res.json.js
  161. +72 −52 test/res.jsonp.js
  162. +1 −0 test/res.links.js
  163. +1 −0 test/res.locals.js
  164. +1 −0 test/res.location.js
  165. +14 −20 test/res.redirect.js
  166. +1 −0 test/res.render.js
  167. +27 −26 test/res.send.js
  168. +778 −193 test/res.sendFile.js
  169. +1 −0 test/res.sendStatus.js
  170. +1 −0 test/res.set.js
  171. +194 −12 test/res.status.js
  172. +1 −0 test/res.type.js
  173. +1 −0 test/res.vary.js
  174. +14 −0 test/support/utils.js
  175. +26 −18 test/utils.js
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ root: true
rules:
eol-last: error
eqeqeq: [error, allow-null]
indent: [error, 2, { SwitchCase: 1 }]
indent: [error, 2, { MemberExpression: "off", SwitchCase: 1 }]
no-trailing-spaces: error
no-unused-vars: [error, { vars: all, args: none, ignoreRestSiblings: true }]
177 changes: 177 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: ci

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
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
- Node.js 15.x
- Node.js 16.x
- Node.js 17.x
- Node.js 18.x

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

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

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

- name: io.js 3.x
node-version: "3.3"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 nyc@11.9.0 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

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

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

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

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

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

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

- name: Node.js 15.x
node-version: "15.14"

- name: Node.js 16.x
node-version: "16.15"

- name: Node.js 17.x
node-version: "17.9"

- name: Node.js 18.x
node-version: "18.0"

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

- 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
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 }'
- name: Run tests
shell: bash
run: npm run test-ci

- name: Lint code
if: steps.list_env.outputs.eslint != ''
run: npm run lint

- name: Collect code coverage
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
20 changes: 4 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# OS X
.DS_Store*
Icon?
._*

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Linux
.directory
*~


# npm
node_modules
package-lock.json
*.log
*.gz


# Coveralls
.nyc_output
coverage

# Benchmarking
benchmarks/graphs

# ignore additional files using core.excludesFile
# https://git-scm.com/docs/gitignore
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

92 changes: 92 additions & 0 deletions Charter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Express Charter

## Section 0: Guiding Principles

The Express project is part of the OpenJS Foundation which operates
transparently, openly, collaboratively, and ethically.
Project proposals, timelines, and status must not merely be open, but
also easily visible to outsiders.

## Section 1: Scope

Express is a HTTP web server framework with a simple and expressive API
which is highly aligned with Node.js core. We aim to be the best in
class for writing performant, spec compliant, and powerful web servers
in Node.js. As one of the oldest and most popular web frameworks in
the ecosystem, we have an important place for new users and experts
alike.

### 1.1: In-scope

Express is made of many modules spread between three GitHub Orgs:

- [expressjs](http://github.com/expressjs/): Top level middleware and
libraries
- [pillarjs](http://github.com/pillarjs/): Components which make up
Express but can also be used for other web frameworks
- [jshttp](http://github.com/jshttp/): Low level HTTP libraries

### 1.2: Out-of-Scope

Section Intentionally Left Blank

## Section 2: Relationship with OpenJS Foundation CPC.

Technical leadership for the projects within the OpenJS Foundation is
delegated to the projects through their project charters by the OpenJS
Cross Project Council (CPC). In the case of the Express project, it is
delegated to the Express Technical Committee ("TC").

This Technical Committee is in charge of both the day-to-day operations
of the project, as well as its technical management. This charter can
be amended by the TC requiring at least two approvals and a minimum two
week comment period for other TC members or CPC members to object. Any
changes the CPC wishes to propose will be considered a priority but
will follow the same process.

### 2.1 Other Formal Project Relationships

Section Intentionally Left Blank

## Section 3: Express Governing Body

The Express project is managed by the Technical Committee ("TC").
Members can be added to the TC at any time. Any committer can nominate
another committer to the TC and the TC uses its standard consensus
seeking process to evaluate whether or not to add this new member.
Members who do not participate consistently at the level of a majority
of the other members are expected to resign.

## Section 4: Roles & Responsibilities

The Express TC manages all aspects of both the technical and community
parts of the project. Members of the TC should attend the regular
meetings when possible, and be available for discussion of time
sensitive or important issues.

### Section 4.1 Project Operations & Management

Section Intentionally Left Blank

### Section 4.2: Decision-making, Voting, and/or Elections

The Express TC uses a "consensus seeking" process for issues that are
escalated to the TC. The group tries to find a resolution that has no
open objections among TC members. If a consensus cannot be reached
that has no objections then a majority wins vote is called. It is also
expected that the majority of decisions made by the TC are via a
consensus seeking process and that voting is only used as a last-resort.

Resolution may involve returning the issue to committers with
suggestions on how to move forward towards a consensus. It is not
expected that a meeting of the TC will resolve all issues on its
agenda during that meeting and may prefer to continue the discussion
happening among the committers.

### Section 4.3: Other Project Roles

Section Intentionally Left Blank

## Section 5: Definitions

Section Intentionally Left Blank
Loading