Merge pull request #292 from koajs/context-delegate
context: delegate etag/last-modified
This commit is contained in:
commit
dc59a604e5
2 changed files with 14 additions and 3 deletions
|
@ -138,10 +138,10 @@ delegate(proto, 'response')
|
||||||
.access('body')
|
.access('body')
|
||||||
.access('length')
|
.access('length')
|
||||||
.access('type')
|
.access('type')
|
||||||
|
.access('lastModified')
|
||||||
|
.access('etag')
|
||||||
.getter('headerSent')
|
.getter('headerSent')
|
||||||
.getter('writable')
|
.getter('writable');
|
||||||
.setter('lastModified')
|
|
||||||
.setter('etag');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request delegation.
|
* Request delegation.
|
||||||
|
|
|
@ -322,6 +322,17 @@ module.exports = {
|
||||||
this.set('ETag', val);
|
this.set('ETag', val);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the ETag of a response.
|
||||||
|
*
|
||||||
|
* @return {String}
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
get etag() {
|
||||||
|
return this.get('ETag');
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the request mime type void of
|
* Return the request mime type void of
|
||||||
* parameters such as "charset".
|
* parameters such as "charset".
|
||||||
|
|
Loading…
Reference in a new issue