Skip to content
Myr

another `req.is()` example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 9413d30 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:lib/request.js+5 added-1 removed
281 unmodified lines
282 * 283 * app.is('an image', function(req){284 * return 0 == req.headers['content-type'].indexOf('image');285 * });286 * 286 *287 * app.is('an attachment', function(req){288 * return 0 == req.headers['content-disposition'].indexOf('attachment');289 * });290 *291 * Now within our route callbacks, we can use to to assert content types292 * such as "image/jpeg", "image/png", etc.293 * 294 * app.post('/image/upload', function(req, res, next){
42 unmodified lines