Comparing version 2.7.0 to 2.8.0
2.8.0 / 2019-08-19 | ||
================== | ||
**features** | ||
* [[`5afff89`](http://github.com/koajs/koa/commit/5afff89eca0efe7081309dc2d123309e825df221)] - feat: accept options in the Application constructor (#1372) (Jake <<djakelambert@gmail.com>>) | ||
**fixes** | ||
* [[`ff70bdc`](http://github.com/koajs/koa/commit/ff70bdc75a30a37f63fc1f7d8cbae3204df3d982)] - fix: typo on document (#1355) (Jeff <<jeff.tian@outlook.com>>) | ||
**others** | ||
* [[`3b23865`](http://github.com/koajs/koa/commit/3b23865340cfba075f61f7dba0ea31fcc27260ec)] - docs: parameter of request.get is case-insensitive (#1373) (Gunnlaugur Thor Briem <<gunnlaugur@gmail.com>>) | ||
* [[`a245d18`](http://github.com/koajs/koa/commit/a245d18a131341feec4f87659746954e78cae780)] - docs: Update response.socket (#1357) (Jeff <<jeff.tian@outlook.com>>) | ||
* [[`d1d65dd`](http://github.com/koajs/koa/commit/d1d65dd29d7bbaf9ea42eaa5fcb0da3fb4df98e9)] - chore(deps): install egg-bin, mm as devDeps not deps (#1366) (Edvard Chen <<pigeon73101@gmail.com>>) | ||
* [[`2c86b10`](http://github.com/koajs/koa/commit/2c86b10feafd868ebd071dda3a222e6f51972b5d)] - test: remove jest and use egg-bin(mocha) (#1363) (Yiyu He <<dead_horse@qq.com>>) | ||
* [[`219bf22`](http://github.com/koajs/koa/commit/219bf22237b11bc375e2e110b93db512f1acfdd4)] - docs(context): update link (#1354) (Peng Jie <<bivinity.pengzjie@gmail.com>>) | ||
* [[`52a6737`](http://github.com/koajs/koa/commit/52a673703a87a93c0f6a8552e6bd73caba66d2eb)] - chore: ignore Intellij IDEA project files (#1361) (Imon-Haque <<38266345+Imon-Haque@users.noreply.github.com>>) | ||
* [[`b9e3546`](http://github.com/koajs/koa/commit/b9e35469d3bbd0a1ee92e0a815ce2512904d4a18)] - docs(api): fix keygrip link (#1350) (Peng Jie <<bivinity.pengzjie@gmail.com>>) | ||
* [[`d4bdb5e`](http://github.com/koajs/koa/commit/d4bdb5ed9e2fe06ec44698b66c029f624135a0ab)] - chore: update eslint and fix lint errors (dead-horse <<dead_horse@qq.com>>) | ||
* [[`12960c4`](http://github.com/koajs/koa/commit/12960c437cc25c53e682cfe5bff06d74a5bb1eb9)] - build: test on 8/10/12 (dead-horse <<dead_horse@qq.com>>) | ||
* [[`00e8f7a`](http://github.com/koajs/koa/commit/00e8f7a1b7603aabdb7fb3567f485cb1c2076702)] - docs: ctx.type aliases ctx.response, not ctx.request (#1343) (Alex Berk <<berkalexanderc@gmail.com>>) | ||
* [[`62f29eb`](http://github.com/koajs/koa/commit/62f29eb0c4dee01170a5511615e5bcc9faca26ca)] - docs(context): update cookies link (#1348) (Peng Jie <<dean.leehom@gmail.com>>) | ||
* [[`b7fc526`](http://github.com/koajs/koa/commit/b7fc526ea49894f366153bd32997e02568c0b8a6)] - docs: fix typo in cookie path default value docs (#1340) (Igor Adamenko <<igoradamenko@users.noreply.github.com>>) | ||
* [[`23f7f54`](http://github.com/koajs/koa/commit/23f7f545abfe1fb6499cd61cc8ff41fd86cef4a0)] - chore: simplify variable (#1332) (kzhang <<godky@users.noreply.github.com>>) | ||
* [[`132c9ee`](http://github.com/koajs/koa/commit/132c9ee63f92a586a120ed3bd6b7ef023badb8bb)] - docs: Clarify the format of request.headers (#1325) (Dobes Vandermeer <<dobesv@gmail.com>>) | ||
* [[`5810f27`](http://github.com/koajs/koa/commit/5810f279a4caeda115f39e429c9671795613abf8)] - docs: Removed Document in Progress note in Koa vs Express (#1336) (Andrew Peterson <<andrew@andpeterson.com>>) | ||
* [[`75233d9`](http://github.com/koajs/koa/commit/75233d974a30af6e3b8ab38a73e5ede67172fc1c)] - chore: Consider removing this return statement; it will be ignored. (#1322) (Vern Brandl <<tkvern@users.noreply.github.com>>) | ||
* [[`04e07fd`](http://github.com/koajs/koa/commit/04e07fdc620841068f12b8edf36f27e6592a0a18)] - test: Buffer() is deprecated due to security and usability issues. so use the Buffer.alloc() instead (#1321) (Vern Brandl <<tkvern@users.noreply.github.com>>) | ||
* [[`130e363`](http://github.com/koajs/koa/commit/130e363856747b487652f04b5550056d7778e43a)] - docs: use 'fs-extra' instead of 'fs-promise' (#1309) (rosald <<35028438+rosald@users.noreply.github.com>>) | ||
* [[`2f2078b`](http://github.com/koajs/koa/commit/2f2078bf998bd3f44289ebd17eeccf5e12e4c134)] - chore: Update PR-welcome badge url (#1299) (James George <<jamesgeorge998001@gmail.com>>) | ||
2.7.0 / 2019-01-28 | ||
@@ -3,0 +33,0 @@ ================== |
@@ -37,9 +37,19 @@ | ||
constructor() { | ||
/** | ||
* | ||
* @param {object} [options] Application options | ||
* @param {string} [options.env='development'] Environment | ||
* @param {string[]} [options.keys] Signed cookie keys | ||
* @param {boolean} [options.proxy] Trust proxy headers | ||
* @param {number} [options.subdomainOffset] Subdomain offset | ||
* | ||
*/ | ||
constructor(options = {}) { | ||
super(); | ||
this.proxy = false; | ||
this.proxy = options.proxy || false; | ||
this.middleware = []; | ||
this.subdomainOffset = 2; | ||
this.env = process.env.NODE_ENV || 'development'; | ||
this.subdomainOffset = options.subdomainOffset || 2; | ||
this.env = options.env || process.env.NODE_ENV || 'development'; | ||
this.keys = options.keys || undefined; | ||
this.context = Object.create(context); | ||
@@ -46,0 +56,0 @@ this.request = Object.create(request); |
@@ -290,7 +290,5 @@ | ||
if (!this.memoizedURL) { | ||
const protocol = this.protocol; | ||
const host = this.host; | ||
const originalUrl = this.originalUrl || ''; // avoid undefined in template string | ||
try { | ||
this.memoizedURL = new URL(`${protocol}://${host}${originalUrl}`); | ||
this.memoizedURL = new URL(`${this.origin}${originalUrl}`); | ||
} catch (err) { | ||
@@ -508,3 +506,3 @@ this.memoizedURL = Object.create(null); | ||
set accept(obj) { | ||
return this._accept = obj; | ||
this._accept = obj; | ||
}, | ||
@@ -511,0 +509,0 @@ |
@@ -51,3 +51,3 @@ | ||
? res.getHeaders() | ||
: res._headers || {}; // Node < 7.7 | ||
: res._headers || {}; // Node < 7.7 | ||
}, | ||
@@ -54,0 +54,0 @@ |
{ | ||
"name": "koa", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "Koa web app framework", | ||
"main": "lib/application.js", | ||
"scripts": { | ||
"test": "jest", | ||
"test-cov": "jest --coverage --runInBand --forceExit", | ||
"test": "egg-bin test test", | ||
"test-cov": "egg-bin cov test", | ||
"lint": "eslint benchmarks lib test", | ||
@@ -51,3 +51,4 @@ "bench": "make -C benchmarks", | ||
"devDependencies": { | ||
"eslint": "^3.17.1", | ||
"egg-bin": "^4.13.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-koa": "^2.0.0", | ||
@@ -57,3 +58,3 @@ "eslint-config-standard": "^7.0.1", | ||
"eslint-plugin-standard": "^2.1.1", | ||
"jest": "^20.0.0", | ||
"mm": "^2.5.0", | ||
"supertest": "^3.1.0" | ||
@@ -66,14 +67,3 @@ }, | ||
"lib" | ||
], | ||
"jest": { | ||
"testMatch": [ | ||
"**/test/!(helpers)/*.js" | ||
], | ||
"coverageReporters": [ | ||
"text-summary", | ||
"lcov" | ||
], | ||
"bail": true, | ||
"testEnvironment": "node" | ||
} | ||
] | ||
} |
@@ -139,3 +139,3 @@ <img src="/docs/logo.png" alt="Koa middleware framework for nodejs"/> | ||
The `Context` object also provides shortcuts for methods on its `request` and `response`. In the prior | ||
examples, `ctx.type` can be used instead of `ctx.request.type` and `ctx.accepts` can be used | ||
examples, `ctx.type` can be used instead of `ctx.response.type` and `ctx.accepts` can be used | ||
instead of `ctx.request.accepts`. | ||
@@ -327,2 +327,2 @@ | ||
[pr-welcoming-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square | ||
[pr-welcoming-url]: https://github.com/koajs/koa | ||
[pr-welcoming-url]: https://github.com/koajs/koa/pull/new |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79086
1521
8