diff --git a/lib/context.js b/lib/context.js index 1e2f0b7..4913a35 100644 --- a/lib/context.js +++ b/lib/context.js @@ -139,10 +139,10 @@ delegate(proto, 'response') .access('body') .access('length') .access('type') + .access('lastModified') + .access('etag') .getter('headerSent') - .getter('writable') - .setter('lastModified') - .setter('etag'); + .getter('writable'); /** * Request delegation. diff --git a/lib/response.js b/lib/response.js index 5ef6708..69732c2 100644 --- a/lib/response.js +++ b/lib/response.js @@ -321,6 +321,17 @@ module.exports = { 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 * parameters such as "charset".