|
sfcode
An Online Competing and Development Environment
|
express.raw to parse bodies into Bufferexpress.text to parse bodies into stringres.sendFilenull/undefined to res.statusX-Forwarded-Hostpb) supportSameSite=None supportContent-Security-Policy headerpath.normalize call103 Early Hintsthrow on invalid type"Request aborted" may be logged in res.sendfileRouter constructor% as last characterTypeError in res.send when given Buffer and ETag header setX-Forwarded-Proto headerroot is incorrectly set to a file"json escape" setting for res.json and res.jsonpexpress.json and express.urlencoded to parse bodiesoptions argument to res.downloadBuffer encoding when not generating ETag for small responsesafe-buffer for improved Buffer APIres.headersSent when availableRegExpX-Forwarded-ForX-Forwarded-For headerimmutable option</html> in default error & redirectsimmutable option.charset set in res.jsonpIf-None-Match token parsingIf-Match token parsingBuffer loadingres.set cannot add charset to Content-TypeDEBUG_MAX_ARRAY_LENGTH</html> in HTML document[Date.parse does not return NaN on invalid dateDate.parse does not return NaN on invalid datenext("router") to exit from routerrouter.use skipped requests routes did notres._headers private fieldreq.url is not seto in path debug to tell types apartObject.create to setup request & response prototypessetprototypeof module to replace __proto__ settingstatuses instead of http module for status messagesDEBUG_FD environment variable set to 3 or highererr cannot be converted to a stringno-cache request directiveIf-None-Match has both * and ETagsETag matching to match specIf-None-Match when no ETag headerDate.parse instead of new Dateno-cache request directiveIf-None-Match has both * and ETagsETag matching to match specres._headers private fieldIf-Match and If-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 and If-Unmodified-Since headersres.getHeaderNames() when availableres.headersSent when available* routereq.ips performanceerr.headers is not an objectacceptRanges option to res.sendFile/res.sendfilecacheControl option to res.sendFile/res.sendfileoptions argument to req.rangecombine optionres.location/res.redirect if not already encodedres.sendFile/res.sendfilereq.get()res.json/res.jsonp in most casesRange header handling in res.sendFile/res.sendfileAccept parsingAccept parameters with quoted equalsAccept parameters with quoted semicolonssameSite optionMax-Age to never be a floating point numberencode is not a functionexpires is not a Dateserializeerr.statusCode if err.status is invaliderr.headers objectstatuses instead of http module for status messagesdecoder option in parse functioncombine option to combine overlapping rangesacceptRanges optioncacheControl optionStream classContent-Range header in 416 responses when using start/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 argumentserializemergeParams: truereq.paramshasOwnPropertyres.format error when only default providedinapp.param<tt>would incorrectly skip values
- OnlyURIError
s are a 400
Fix using*` before params in routesFix using capture groups before params in routesSimplify res.cookie to call res.appendUse array-flatten module for flattening arraysdeps: accepts1.2.9
- deps: mime-types2.1.1
- perf: avoid argument reassignment & argument slice
- perf: avoid negotiator recursive construction
- perf: enable strict mode
- perf: remove unnecessary bitwise operator
deps: cookie@0.1.3
- perf: deduce the scope of try-catch deopt
- perf: remove argument reassignments
deps: escape-html@1.0.2deps: etag1.7.0
- Always include entity length in ETags for hash length extensions
- Generate non-Stats ETags using MD5 only (no longer CRC32)
- Improve stat performance by removing hashing
- Improve support for JXcore
- Remove base64 padding in ETags to shorten
- Support "fake" stats objects in environments without fs
- Use MD5 instead of MD4 in weak ETags over 1KB
deps: finalhandler@0.4.0
- Fix a false-positive when unpiping in Node.js 0.8
- Support
statusCode property on Error objects
- Use
unpipe module for unpiping requests
- deps: escape-html@1.0.2
- deps: on-finished2.3.0
- perf: enable strict mode
- perf: remove argument reassignment
deps: fresh@0.3.0
- Add weak
ETag matching support
deps: on-finished2.3.0
- Add defined behavior for HTTP
CONNECT requests
- Add defined behavior for HTTP
Upgrade requests
- deps: ee-first@1.1.1
deps: path-to-regexp@0.1.6deps: send@0.13.0
- Allow Node.js HTTP server to set
Date response header
- Fix incorrectly removing
Content-Location on 304 response
- Improve the default redirect response headers
- Send appropriate headers on default error response
- Use
http-errors for standard emitted errors
- Use
statuses instead of http module for status messages
- deps: escape-html@1.0.2
- deps: etag1.7.0
- deps: fresh@0.3.0
- deps: on-finished2.3.0
- perf: enable strict mode
- perf: remove unnecessary array allocations
deps: serve-static1.10.0
- Add
fallthrough option
- Fix reading options from options prototype
- Improve the default redirect response headers
- Malformed URLs now
next() instead of 400
- deps: escape-html@1.0.2
- deps: send@0.13.0
- perf: enable strict mode
- perf: remove argument reassignment
deps: type-is1.6.3
- deps: mime-types2.1.1
- perf: reduce try block size
- perf: remove bitwise operations
perf: enable strict modeperf: isolate app.render try blockperf: remove argument reassignments in applicationperf: remove argument reassignments in request prototypeperf: remove argument reassignments in response prototypeperf: remove argument reassignments in routingperf: remove argument reassignments in Viewperf: skip attempting to decode zero length stringperf: use saved reference to http.STATUS_CODESfsisFinished(req) when data bufferedconstructorhasOwnProperty is presentextensions or index options"Request aborted" is logged using res.sendFileECONNRESET errors from res.sendFile usagereq.host when using "trust proxy" hops countreq.protocol/req.secure when using "trust proxy" hops countcode on aborted connections from res.sendFile"trust proxy" setting to inherit when app is mountedETags for all request responsesGET and HEAD requestscontent-type to parse Content-Type headersoptionshasBody Transfer-Encoding check*/*)res.redirect double-calling res.end for HEAD requestsres.append(field, val) to append headers: in name for app.param(name, fn)req.param() – use req.params, req.body, or req.query insteadapp.param(fn)OPTIONS responses to include the HEAD method properlyres.sendFile not always detecting aborted connectionOPTIONS response handlerAllow header for OPTIONS to not contain duplicate methodsres.sendFile when HEAD or 304req.fresh/req.stale without response headersres.send double-calling res.end for HEAD requestsres.sendfile logging standard write errorsres.sendFile logging standard write errorsarrayLimit behavior:// in the pathres.send(status) to mention res.sendStatus(status)content-disposition module for res.attachment/res.downloadContent-Disposition headerpath.resolve in view lookupDEBUG_FD env variable supporton-finished to determine request statusres.redirect body when redirect status specifiedforwarded npm modulepath in app.userouter.use to accept array of middleware without pathapp.use argumentsapp.use to accept array of middleware without pathres.sendStatusres.sendFile, res.sendfile, and res.downloaderr will be populated with request aborted errorreq.subdomainsetag to generate ETag headersmime-typesX-Content-Type-Options: nosniff headerlastModified optionetag to generate ETag headerlastModified optionhasbody to be true for content-length: 0Vary header string as fieldrootfd leak in Node.js 0.10 for fs.ReadStreamreq.originalUrl valuesres.downloadres.sendFileroot option specifiedres.sendfile – use res.sendFile insteadapp.use()extensions optionextensions optionres.sendfile regression for serving directory index filesError.stackTraceLimit is too lowreq.protocol for proxy-direct connections -app.set('query parser', 'extended')parse with "qs" module -app.set('query parser', 'simple')parse with "querystring" core module -app.set('query parser', false)disable query string parsing -app.set('query parser', true)enable simple parsingdeprecateres.json(status, obj)-- useres.status(status).json(obj)insteaddeprecateres.jsonp(status, obj)-- useres.status(status).jsonp(obj)insteaddeprecateres.send(status, body)-- useres.status(status).send(body)` insteadTRACE_DEPRECATION environment variable--no-deprecation argument--trace-deprecation argumentRegExpdotfiles optionmaxAge value to 1 yearBuffer creation in res.sendsubapp.mountpath regression for app.use(subapp)app.use()req.param(name, fn) handlersres.redirect(url, status) – use res.redirect(status, url) insteadres.send(status, num) to send num as json (not error)res.jsonp returns JSON responsepath in app.use(path, fn)RegExptry blocksapp.use(fn)CONNECTres methodsreq.methodreq.accepts*res.send(body, status)res.vary()headers option to res.sendfilemergeParams option to Routerreq.params from parent routesreq.hostname – correct name for what req.host returnsdepd modulereq.host – use req.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 by ms)maxAge (converted by ms)setHeaders optionres.attachment Unicode filenames in Safariexpress:routerreq.params[name] from app.param()escape-html for HTML escapingvary module for res.varymax-age in Cache-Control in correct formatescape-html for escaping -app.set('etag', function(body, encoding){ return '"etag"' })custom etag generation -app.set('etag', 'weak')weak tag -app.set('etag', 'strong')strong etag -app.set('etag', false)turn off -app.set('etag', true)standard etagmarkres.send` ETag as weak and reduce collisionsrouter.param() callbacksreq.baseUrl to access the path stripped from req.url in routesapp.VERB for the same pathrouter.param() only when necessary instead of every match -app.set('trust proxy', 1)trust first hop -app.set('trust proxy', 'loopback')trust loopback addresses -app.set('trust proxy', '10.0.0.1')trust single IP -app.set('trust proxy', '10.0.0.1/16')trust subnet -app.set('trust proxy', '10.0.0.1, 10.0.0.2')trust list -app.set('trust proxy', false)turn off -app.set('trust proxy', true)trust everythingset propercharsetinContent-Typeforres.send`app.del() – use app.delete() insteadres.json(obj, status) – use res.json(status, obj) insteadres.json(status, num) requires res.status(status).json(num)res.jsonp(obj, status) – use res.jsonp(status, obj) insteadres.jsonp(status, num) requires res.status(status).jsonp(num)req.next when inside router instanceETag header in HEAD requestsContent-Type for res.jsonpapp.purgerouter.purgeapp.allenable() methodreq.host for IPv6 literalsres.jsonp error if callback param is objectres.sendfile to sendres.header and res.setres.attachment and res.downloadsend modulemultipart as a shorthandexpress.createServer() - it has been deprecated for a long time. Use express()app.configure - use logic in your own app codeapp.router - is removedreq.auth - use basic-auth insteadreq.accepted* - use req.accepts*() insteadres.location - relative URL resolution is removedres.charset - include the charset in the content type when using res.set()staticapp.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.acceptsEncodingsreq.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's Router#route() method to create a new routefieldETag matching supportDate response headerContent-Location on 304 responsehttp-errors for standard emitted errorsstatuses instead of http module for status messagesextensions or index optionsreq.host when using "trust proxy" hops countreq.protocol/req.secure when using "trust proxy" hops count"trust proxy" setting to inherit when app is mountedETags for all request responsesGET and HEAD requestscontent-type to parse Content-Type headerscontent-type to parse Content-Type headersoptionsOPTIONS responses to include the HEAD method propertyreadline for prompt in express(1)req.fresh/req.stale without response headers:// in the pathutils.merge deprecation warningscontent-disposition module for res.attachment/res.downloadContent-Disposition headeretag module to generate ETag headershttp-errors module for creating errorsutils-merge module for merging objectsDEBUG_FD env variable supportloggerforwarded npm modulecrc instead of buffer-crc32 for speedreq.subdomains on empty hostX-Forwarded-Host in req.subdomainsreq.subdomainslastModified optionetag to generate ETag headerVary header string as fieldrootfd leak in Node.js 0.10 for fs.ReadStreamloggerres.locationquery middleware breaking with argumentextensions optionres.sendfile regression for serving directory index filesError.stackTraceLimit is too lowreq.protocol for proxy-direct connectionsres.sendfile to sendTRACE_DEPRECATION environment variable--no-deprecation argument--trace-deprecation argumentRegExpdotfiles optionmaxAge value to 1 yearres.redirect(url, status) – use res.redirect(status, url) insteadres.send(status, num) to send num as json (not error)res.jsonp returns JSON responsedeps: debug@1.0.3
deps: methods@1.1.0
CONNECTdeps: parseurl1.1.3
app.configurereq.authbasic-auth to parse Authorization headermaxage (converted by ms)media-typer to alter content-type charsetconnect(middleware) – use app.use(middleware) insteadconnect.createServer() – use connect() insteadres.setHeader() patch to work with with get -> append -> set patterndepd moduleverify option to json – use body-parser npm module insteadverify option to urlencoded – use body-parser npm module insteaddepd modulefinalhandler for final response handlingmedia-typer to parse content-type for charsetescape-html for HTML escapingvary module for res.varymethodOverride() – use method-override npm module insteadmax-age in Cache-Control in correct format -app.set('etag', function(body, encoding){ return '"etag"' })custom etag generation -app.set('etag', 'weak')weak tag -app.set('etag', 'strong')strong etag -app.set('etag', false)turn off -app.set('etag', true)` standard etagres.send ETag as weak and reduce collisionsContent-Type for res.jsonpcharset in Content-Type for res.sendres.charset appending charset when content-type has one -app.set('trust proxy', 1)trust first hop -app.set('trust proxy', 'loopback')trust loopback addresses -app.set('trust proxy', '10.0.0.1')trust single IP -app.set('trust proxy', '10.0.0.1/16')trust subnet -app.set('trust proxy', '10.0.0.1, 10.0.0.2')trust list -app.set('trust proxy', false)turn off -app.set('trust proxy', true)` trust everythingres.headerSent – use res.headersSentres.on("header") – use on-headers module insteadres.appendHeader that would append in wrong orderapp.del() – use app.delete() insteadres.json(obj, status) – use res.json(status, obj) insteadres.json(status, num) requires res.status(status).json(num)res.jsonp(obj, status) – use res.jsonp(status, obj) insteadres.jsonp(status, num) requires res.status(status).jsonp(num)app.purgerouter.purgeapp.allres.appendHeaderres.headerSent to return Booleanres.headersSent for node.js 0.8enable() methodreq.host for IPv6 literalsres.jsonp error if callback param is objectreq.subdomains when no Host is presentreq.host when no Host is present, return undefinedreq.hostres.set()req.subdomainsres.location(url) implementing res.redirect()-like setting of Locationreq.authres.cookie() options objectres.send() Etagsres.redirect() for old browsers interpreting as htmlmake cleanreq.auth test coverageres.jsonp(). Closes #1374res.redirect() status. Closes #1336res.json() to retain previously defined Content-Types. Closes #1349res.redirect() to utilize a pathname-relative Location again. Closes #1382res.send()res.jsonp(). Closes #1307connect.cookieParser() ("s:" prefix was missing) [tnydwrds]res.render() clobbering of "locals".createServer() & remove old stale examplesres.redirect() linkres.redirect("//foo.com")) supportexpress(1) -h flag, use -H for hogan. Closes #1245res.sendfile() socket error handling regressionsend() root normalization regressionerr.view property for view errors. Closes #1226res.sendfile() to use send() moduleres.send to use "response-send" moduleapp.locals.use and res.locals.use, use regular middlewareres.json(obj, status) support back for BCreq.authreq.range(size)res.links(obj)res.send(body, status) support back for backwards compat.default() support to res.format()req.freshres.send() freshness check, respect res.statusCode--hjs to express(1) [nullfirm]fresh depres.send() always checks freshness+ support to the routerreq.hostreq.param() to check route firstres.format() callback to override default 406 behaviourres.redirect() 406. Closes #1154req.ip{ signed: true } option to res.cookie()res.signedCookie()req.ipsreq.ips[] in jsonp callback. Closes #1128PORT env var support in generated template. Closes #1118 [benatkin]app.routes. Closes #887res.locals.use(). Closes #1120res.send()res.set() values to stringsstatic() in generated apps below routerres.send() only set ETag when not previously setmake test now runs unit / acceptance testsmake benchmark backres.send() support for String objectsres.header() and req.header() aliases for BCexpress.createServer() for BCexpressInit() middleware self-awareapp.locals.use(callback)app.locals objectapp.locals(obj)res.locals objectres.locals(obj)res.format() for content-negotiationapp.engine()res.cookie() JSON cookie supportreq.subdomainsreq.protocolreq.securereq.pathreq.ipsreq.freshreq.stalereq.accepts()res.set(obj)res.set(field, value)res.get(field)app.get(setting). Closes #842req.acceptsLanguage()req.acceptsCharset()req.acceptedreq.acceptedLanguagesreq.acceptedCharsetsres.redirect(). Closes #92--less support to express(1)express.response prototypeexpress.request prototypeexpress.application prototypeapp.path()app.render()res.type() to replace res.contentType()res.redirect() to add relative supportsupportRemovedreq.notify()Removedapp.register()Removedapp.redirect()Removedapp.is()Removedapp.helpers()Removedapp.dynamicHelpers()Fixedres.sendfile()` with non-GET. Closes #723express(1) generated app app.address() before listening [mmalecki]app.all duplicate DELETE requests [mscdex]filename on cached templates [matthewleon]express(1) eol on 0.4.x. Closes #947req.is() when a charset is presentmake test-cov since it wont work with node 0.5.xreq.pathres.redirect() HEAD support. [reported by xerox]req.flash(), only escape argsapp.routes.all(). Closes #803Route to use a single array of callbacksapp.param(). Closes #801 Closes #805qs >= 0.3.1res.redirect() on windows due to join() usage. Closes #808res.header() intention of a set, even when undefined*, value no longer requiredres.send(204) support. Closes #771status option special-case. Closes #739options.filename, exposing the view path to template enginesres.json() JSONP support. Closes #737app.configure() calls. Closes #735res.send() using res.json()path === null don't default itres.status(code)res.json(), an explicit version of res.send(obj)req.get(field, param)express(1) generated app outputs the envcontent-negotiation examplenpm testexpress(1)express(1) adds express as a depprepublishreq.route, exposing the current routeexpress(1)app.param() function for optional params. Closes #682res.partial() callsapp.options()Collection, ex: ‘app.get(’/user/:id').remove();Added support forapp.param(fn)to define param logicRemovedapp.param()` support for callback with return value.view as alias for .View./examples/sayres.sendfile() bug preventing the transfer of files with spacesapp.match() as app.match.all()app.lookup() as app.lookup.all()app.remove() for app.remove.all()app.remove.VERB()res.clearCookie()res.helpers() as alias of res.locals()res.send(). Closes #632. [Daniel * Dependency connect >= 1.4.0app.param() callbacks once per route middleware. Closes #638res.download() connection errorsfilename option passing to template enginelayout(path) helper to change the layout within a view. Closes #610partial() collection object support. Previously only anything with .length would work. When .length is present one must still be aware of holes, however now ‘{ collection: {foo: 'bar’}}is valid, exposes keyInCollectionandkeysInCollection`.request and response localsExpress instead of Connectapp.lookup.VERB(), ex ‘app.lookup.put(’/user/:id'). Closes #606Addedapp.match.VERB(), exapp.match.put('/user/12'). Closes #606Addedapp.VERB(path)as alias ofapp.lookup.VERB().Dependencyconnect >= 1.2.0`err.view object when failing to locate a viewres.partial() call next(err) when no callback is given [reported by aheckmann]res.send(undefined) responds with 204 [aheckmann]<root>/_?<name> partial lookup support. Closes #447request, response, and app local variablessettings local variable, containing the app's settingsreq.flash() exception if req.session is not availableres.send(bool) support (json response)res.render()res.locals() without object returns the localsres.locals(obj) to compliment res.local(key, val)res.partial() callback supportres.render()partial() "locals" are now optionalSlowBuffer support. Closes #584 [reported by tyrda01]{req,res}.app reference when mounting [Ben Weaver]HTTPSServer constructorres.contentType() literal The original ‘res.contentType(’.json'), res.contentType('application/json'), andres.contentType('json')` will work now.res.render() status option support backres.render().charset support (via connect 1.0.4)./views/user/index.jade if you create ./views/user/layout.jade it will be used in favour of the root layout.res.redirect(). RFC states absolute url [reported by unlink]res.send() string charset to utf8Partial constructor (not currently used).locals support back to aid in migration processres.cookie() maxAge supportreq.header() Referrer / Referer special-case, either worksres.redirect(), now respects the mount-pointunion() util, taking place of merge(clone()) combores.local(name, val) for progressive view localsreq.param(name, default)app.disabled() and app.enabled()app.register() support for omitting leading ".", either worksres.partial(), using the same interface as partial() within a view. Closes #539app.param() to map route params to async/sync logicapp.helpers() as app.locals(). Closes #481res.contentType()cache views setting, defaulting to enabled in "production" envreq.accepts() support for extensionsres.download() and res.sendfile() now utilize Connect's static file server connect.static.send().connect.utils.mime() with npm mime modulereq.query to be pre-defined (via middleware or other parentengine.render(str, options, callback), now engine.compile(str, options) -> Function, the returned function accepts fn(locals).req.param() bug returning Array.prototype methods. Closes #552Stream#pipe() instead of sys.pump() in res.sendfile()req.query to be pre-defined (via middleware or other parent app)render() setting inheritance. Mounted apps would not inherit "view engine"view engine setting bug when period is in dirnamesession() callqs dependency to package.jsonrequire()s for latest connect supportconnect.routercreateServer() previously the foo middleware passed to createServer(foo) would not have access to Express methods such as res.send() or props like req.query etc.res.redirect() bodyres.redirect() supporting text/plain and text/html via Accept.req.is() to aid in content negotiationapp.all() support [thanks aheckmann]providing the "user" local, vs previouslypartial('user', { object: user })`.partial() support for array-like collections. Closes #434res.sendfile() (and res.download() etc)express(1) generated app using 2 spaces instead of 4express(1) app generation. Closes #391app.flashFormattersres.sendfile() using sys.pump() when >= "stream threshold"res.sendfile()res.send() HEAD supportres.clearCookie()res.cookie()res.render() headers optionres.redirect() response bodiesres.render() status option support. Closes #425 [thanks aheckmann]res.sendfile() responding with 403 on malicious pathres.download() bug; when an error occurs remove Content-Dispositionres.send() 204. Closes #419res.header(). Closes #402listenFD() is called instead of listen(). [thanks guillermo]app.register() for template engine mapping. Closes #390res.render() callback support as second argument (no options)res.download()res.sendfile()express.middlewareName() vs connect.middlewareName()express(1) generated app. Closes #384res.sendfile() error handling, defer via next()res.render() callback when a layout is used [thanks guillermo]make install creating ~/.node_libraries when not presentServer constructorServer#helpers() for view localsServer#dynamicHelpers() for dynamic view locals. Closes #349Server#route for mounted apps. Closes #363res.render() exceptions, now passed to next() when no callback is given [thanks guillermo]Array checks, now Array.isArray()helpers export which act as additional local variablesmake install (for the executable)express executable for setting up simple app templatesmake init for submodulesmake init to work with older versions of gitmake test now builds libxmljs.node before testing