Skip to content
Myr

Fixed parseQuality(), exclude q=0

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 9c7380e · Browse files · 2 files+9 added−0 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+9 added−0 removed

  • tests:+6 added−0 removed
  • other:+3 added−0 removed

2 files+9 added−0 removed

modified:lib/utils.js+3 added
modified:test/utils.js+6 added
62 unmodified lines
63 arr[0].value.should.equal('application/json');64 arr[1].value.should.equal('text/html');65 arr[2].value.should.equal('text/plain');66 })67 68 it('should exclude those with a quality of 0', function(){69 var str = 'text/plain;q=.2, application/json, text/html;q=0';70 var arr = utils.parseQuality(str);71 arr.should.have.length(2);72 })73})7475describe('utils.parseAccept(str)', function(){76 it('should provide .type', function(){
88 unmodified lines