diff --git a/docs/api/context.md b/docs/api/context.md index 2f83fc0..b83b061 100644 --- a/docs/api/context.md +++ b/docs/api/context.md @@ -62,6 +62,8 @@ - `ctx.redirect()` - `ctx.attachment()` - `ctx.set()` + - `ctx.lastModified=` + - `ctx.etag=` ## API diff --git a/lib/context.js b/lib/context.js index 595fd34..721763a 100644 --- a/lib/context.js +++ b/lib/context.js @@ -379,6 +379,22 @@ module.exports = { return this.request.type; }, + /** + * Delegate to Response#lastModified=. + */ + + set lastModified(val) { + this.response.lastModified = val; + }, + + /** + * Delegate to Response#etag=. + */ + + set etag(val) { + this.response.etag = val; + }, + /** * Delegate to Request#accepts(). */