Skip to content
Myr

Finished req.accepts()

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 9750817 · Browse files · 2 files+35 added−9 removed
This commit

State

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

Diff stats

2 files+35 added−9 removed

  • tests:+2 added−3 removed
  • other:+33 added−6 removed

2 files+35 added−9 removed

modified:lib/express/request.js+33 added-6 removed
modified:test/request.test.js+2 added-3 removed
55 unmodified lines
56 assert.strictEqual(true, req.accepts('json'));57 assert.strictEqual(true, req.accepts('application/json'));58 assert.strictEqual(false, req.accepts('xml'));59 assert.strictEqual(false, req.accepts());60 assert.strictEqual(false, req.accepts(' '));60 res.send('ok');61 });62 63 app.get('/type', function(req, res){64 assert.strictEqual(true, req.accepts('html'));65 assert.strictEqual(true, req.accepts('text/html'));66 assert.strictEqual(true, req.accepts('json'));67 assert.strictEqual(true, req.accepts('application/json'));69 assert.strictEqual(false, req.accepts('svg'));70 assert.strictEqual(false, req.accepts('image/svg'));68 assert.strictEqual(false, req.accepts('png'));69 assert.strictEqual(false, req.accepts('image/png'));70 res.send('ok'); 71 });72 73 assert.response(app,
36 unmodified lines