This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.1.x
->4.16.x
By merging this PR, the below vulnerabilities will be automatically resolved:
Release Notes
expressjs/express
v4.16.0
Compare Source
===================
"json escape"
setting forres.json
andres.jsonp
express.json
andexpress.urlencoded
to parse bodiesoptions
argument tores.download
Buffer
encoding when not generating ETag for small responsesafe-buffer
for improved Buffer APIres.headersSent
when availableRegExp
X-Forwarded-For
X-Forwarded-For
headerimmutable
option</html>
in default error & redirectsimmutable
option.charset
set inres.jsonp
v4.15.5
Compare Source
===================
If-None-Match
token parsingIf-Match
token parsingv4.15.4
Compare Source
===================
Buffer
loadingv4.15.3
Compare Source
===================
res.set
cannot add charset toContent-Type
DEBUG_MAX_ARRAY_LENGTH
</html>
in HTML documentv4.15.2
Compare Source
===================
[
v4.15.1
Compare Source
===================
Date.parse
does not returnNaN
on invalid dateDate.parse
does not returnNaN
on invalid datev4.15.0
Compare Source
===================
next("router")
to exit from routerrouter.use
skipped requests routes did notres._headers
private fieldreq.url
is not set%o
in path debug to tell types apartObject.create
to setup request & response prototypessetprototypeof
module to replace__proto__
settingstatuses
instead ofhttp
module for status messagesDEBUG_FD
environment variable set to3
or highererr
cannot be converted to a stringContent-Security-Policy: default-src 'self'
headerno-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specIf-None-Match
when noETag
headerDate.parse
instead ofnew Date
no-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specres._headers
private fieldIf-Match
andIf-Unmodified-Since
headersres.getHeaderNames()
when availableres.headersSent
when availableno-cache
request directiveIf-None-Match
has both*
and ETagsETag
matching to match specres._headers
private fieldIf-Match
andIf-Unmodified-Since
headersres.getHeaderNames()
when availableres.headersSent
when available*
routereq.ips
performancev4.14.1
Compare Source
===================
err.headers
is not an objectv4.14.0
Compare Source
===================
acceptRanges
option tores.sendFile
/res.sendfile
cacheControl
option tores.sendFile
/res.sendfile
options
argument toreq.range
combine
optionres.location
/res.redirect
if not already encodedres.sendFile
/res.sendfile
req.get()
res.json
/res.jsonp
in most casesRange
header handling inres.sendFile
/res.sendfile
Accept
parsingAccept
parameters with quoted equalsAccept
parameters with quoted semicolonssameSite
optionMax-Age
to never be a floating point numberencode
is not a functionexpires
is not aDate
serialize
err.statusCode
iferr.status
is invaliderr.headers
objectstatuses
instead ofhttp
module for status messagesdecoder
option inparse
functioncombine
option to combine overlapping rangesacceptRanges
optioncacheControl
optionStream
classContent-Range
header in 416 responses when usingstart
/end
optionsContent-Range
header missing from default 416 responsespath
contains raw non-URL characterspath
starts with multiple forward slashesRange
headersacceptRanges
optioncacheControl
optionreq.url
contains raw non-URL charactersRange
headersfield
argumentv4.13.4
Compare Source
===================
serialize
v4.13.3
Compare Source
===================
mergeParams: true
req.params
v4.13.2
Compare Source
===================
v4.13.1
Compare Source
===================
hasOwnProperty
v4.13.0
Compare Source
===================
res.format
error when onlydefault
providednext('route')
inapp.param
would incorrectly skip valuesdecodeURIComponent
URIError
s are a 400*
before params in routesres.cookie
to callres.append
array-flatten
module for flattening arraysstatusCode
property onError
objectsunpipe
module for unpiping requestsETag
matching supportCONNECT
requestsUpgrade
requestsDate
response headerContent-Location
on 304 responsehttp-errors
for standard emitted errorsstatuses
instead ofhttp
module for status messagesfallthrough
optionnext()
instead of 400app.render
try blockView
http.STATUS_CODES
v4.12.4
Compare Source
===================
fs
isFinished(req)
when data bufferedconstructor
v4.12.3
Compare Source
===================
hasOwnProperty
is presentextensions
orindex
optionsv4.12.2
Compare Source
===================
"Request aborted"
is logged usingres.sendFile
v4.12.1
Compare Source
===================
ECONNRESET
errors fromres.sendFile
usagereq.host
when using "trust proxy" hops countreq.protocol
/req.secure
when using "trust proxy" hops countcode
on aborted connections fromres.sendFile
v4.12.0
Compare Source
===================
"trust proxy"
setting to inherit when app is mountedETag
s for all request responsesGET
andHEAD
requestscontent-type
to parseContent-Type
headersoptions
hasBody
Transfer-Encoding
check*/*
)v4.11.2
Compare Source
===================
res.redirect
double-callingres.end
forHEAD
requestsv4.11.1
Compare Source
===================
v4.11.0
Compare Source
===================
res.append(field, val)
to append headers:
inname
forapp.param(name, fn)
req.param()
-- usereq.params
,req.body
, orreq.query
insteadapp.param(fn)
OPTIONS
responses to include theHEAD
method properlyres.sendFile
not always detecting aborted connectionv4.10.8
Compare Source
===================
OPTIONS
response handlerv4.10.7
Compare Source
===================
Allow
header forOPTIONS
to not contain duplicate methodsres.sendFile
whenHEAD
or 304v4.10.6
Compare Source
===================
req.fresh
/req.stale
without response headersv4.10.5
Compare Source
===================
res.send
double-callingres.end
forHEAD
requestsv4.10.4
Compare Source
===================
res.sendfile
logging standard write errorsv4.10.3
Compare Source
===================
res.sendFile
logging standard write errorsarrayLimit
behaviorv4.10.2
Compare Source
===================
v4.10.1
Compare Source
===================
://
in the pathv4.10.0
Compare Source
===================
app.set('views', array)
res.send(status)
to mentionres.sendStatus(status)
content-disposition
module forres.attachment
/res.download
Content-Disposition
headerpath.resolve
in view lookupDEBUG_FD
env variable supporton-finished
to determine request statusv4.9.8
Compare Source
==================
res.redirect
body when redirect status specifiedv4.9.7
Compare Source
==================
v4.9.6
Compare Source
==================
v4.9.5
Compare Source
==================
forwarded
npm modulev4.9.4
Compare Source
==================
v4.9.3
Compare Source
==================
v4.9.2
Compare Source
==================
path
inapp.use
router.use
to accept array of middleware without pathapp.use
argumentsv4.9.1
Compare Source
==================
app.use
to accept array of middleware without pathv4.9.0
Compare Source
==================
res.sendStatus
res.sendFile
,res.sendfile
, andres.download
err
will be populated with request aborted errorreq.subdomains
etag
to generateETag
headersmime-types
X-Content-Type-Options: nosniff
headerlastModified
optionetag
to generateETag
headerlastModified
optionhasbody
to be true forcontent-length: 0
Vary
header string asfield
v4.8.8
Compare Source
==================
root
v4.8.7
Compare Source
==================
v4.8.6
Compare Source
==================
v4.8.5
Compare Source
==================
v4.8.4
Compare Source
==================
fd
leak in Node.js 0.10 forfs.ReadStream
v4.8.3
Compare Source
==================
req.originalUrl
valuesv4.8.2
Compare Source
==================
v4.8.1
Compare Source
==================
res.download
v4.8.0
Compare Source
==================
res.sendFile
root
option specifiedres.sendfile
-- useres.sendFile
insteadapp.use()
extensions
optionextensions
optionv4.7.4
Compare Source
==================
res.sendfile
regression for serving directory index filesv4.7.3
Compare Source
==================
v4.7.2
Compare Source
==================
v4.7.1
Compare Source
==================
Error.stackTraceLimit
is too lowv4.7.0
Compare Source
==================
req.protocol
for proxy-direct connectionsapp.set('query parser', parser)
app.set('query parser', 'extended')
parse with "qs" moduleapp.set('query parser', 'simple')
parse with "querystring" core moduleapp.set('query parser', false)
disable query string parsingapp.set('query parser', true)
enable simple parsingres.json(status, obj)
-- useres.status(status).json(obj)
insteadres.jsonp(status, obj)
-- useres.status(status).jsonp(obj)
insteadres.send(status, body)
-- useres.status(status).send(body)
insteadTRACE_DEPRECATION
environment variable--no-deprecation
argument--trace-deprecation
argumentRegExp
dotfiles
optionmaxAge
value to 1 yearBuffer
creation inres.send
v4.6.1
Compare Source
==================
subapp.mountpath
regression forapp.use(subapp)
v4.6.0
Compare Source
==================
app.use()
req.param(name, fn)
handlersres.redirect(url, status)
-- useres.redirect(status, url)
insteadres.send(status, num)
to sendnum
as json (not error)res.jsonp
returns JSON responsepath
inapp.use(path, fn)
RegExp
try
blocksapp.use(fn)
CONNECT
res
methodsv4.5.1
Compare Source
==================
req.method
v4.5.0
Compare Source
==================
req.accepts*
res.send(body, status)
res.vary()
headers
option tores.sendfile
mergeParams
option toRouter
req.params
from parent routesreq.hostname
-- correct name for whatreq.host
returnsdepd
modulereq.host
-- usereq.hostname
insteadroute.all
is only routerouter.param()
only when route matchesreq.params
after invoking routerfinalhandler
for final response handlingmedia-typer
to alter content-type charsetmaxage
(converted byms
)maxAge
(converted byms
)setHeaders
optionv4.4.5
Compare Source
==================
v4.4.4
Compare Source
==================
res.attachment
Unicode filenames in Safariexpress:router
v4.4.3
Compare Source
==================
req.params[name]
fromapp.param()
escape-html
for HTML escapingv4.4.2
Compare Source
==================
vary
module forres.vary
v4.4.1
Compare Source
==================
max-age
inCache-Control
in correct formatescape-html
for escapingv4.4.0
Compare Source
==================
app.set('etag', val)
app.set('etag', function(body, encoding){ return '"etag"' })
custom etag generationapp.set('etag', 'weak')
weak tagapp.set('etag', 'strong')
strong etagapp.set('etag', false)
turn offapp.set('etag', true)
standard etagres.send
ETag as weak and reduce collisionsv4.3.2
Compare Source
==================
router.param()
callbacksv4.3.1
Compare Source
==================
app.VERB
for the same path"v4.3.0
Compare Source
==================
req.baseUrl
to access the path stripped fromreq.url
in routesapp.VERB
for the same pathrouter.param()
only when necessary instead of every matchapp.set('trust proxy', trust)
app.set('trust proxy', 1)
trust first hopapp.set('trust proxy', 'loopback')
trust loopback addressesapp.set('trust proxy', '10.0.0.1')
trust single IPapp.set('trust proxy', '10.0.0.1/16')
trust subnetapp.set('trust proxy', '10.0.0.1, 10.0.0.2')
trust listapp.set('trust proxy', false)
turn offapp.set('trust proxy', true)
trust everythingcharset
inContent-Type
forres.send
v4.2.0
Compare Source
==================
app.del()
-- useapp.delete()
insteadres.json(obj, status)
-- useres.json(status, obj)
insteadres.json(status, num)
requiresres.status(status).json(num)
res.jsonp(obj, status)
-- useres.jsonp(status, obj)
insteadres.jsonp(status, num)
requiresres.status(status).jsonp(num)
req.next
when inside router instanceETag
header inHEAD
requestsContent-Type
forres.jsonp
app.purge
router.purge
app.all
enable()
methodv4.1.2
Compare Source
==================
req.host
for IPv6 literalsres.jsonp
error if callback param is objectv4.1.1
Compare Source
==================
v4.1.0
Compare Source
==================
res.sendfile
tosend
res.header
andres.set
res.attachment
andres.download
send
modulemultipart
as a shorthandv4.0.0
Compare Source
==================
express.createServer()
- it has been deprecated for a long time. Useexpress()
app.configure
- use logic in your own app codeapp.router
- is removedreq.auth
- usebasic-auth
insteadreq.accepted*
- usereq.accepts*()
insteadres.location
- relative URL resolution is removedres.charset
- include the charset in the content type when usingres.set()
static
app.route
->app.mountpath
when mounting an express app in another express appjson spaces
no longer enabled by default in developmentreq.accepts*
->req.accepts*s
- i.e.req.acceptsEncoding
->req.acceptsEncodings
req.params
is now an object instead of an arrayres.locals
is no longer a function. It is a plain js object. Treat it as such.res.headerSent
->res.headersSent
to match node.js ServerResponse objectreq.accepts*
with acceptsreq.is
with type-isapp.router()
- returns the app Router instanceapp.route()
- Proxy to the app'sRouter#route()
method to create a new routev3.21.2
Compare Source
===================
field
v3.21.1
Compare Source
===================
v3.21.0
Compare Source
===================
ETag
matching supportDate
response headerContent-Location
on 304 responsehttp-errors
for standard emitted errorsstatuses
instead ofhttp
module for status messagesv3.20.3
Compare Source
===================