Skip to content
Myr

Express.Mime module

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

authored by visionmedia · committed by visionmedia · parent e6c9318 · Browse files · 4 files+222 added−186 removed
This commit

State

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

Diff stats

4 files+222 added−186 removed

  • tests:+6 added−4 removed
  • other:+216 added−182 removed

4 files+222 added−186 removed

modified:lib/express.mime.js+199 added-182 removed
modified:lib/express.session.js+10 added
modified:lib/express.view.js+7 added
12// Express - View - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34(function(){5 6 Express.View = {7 8 }9 10})()
modified:spec/spec.mime.js+6 added-4 removed
12use(Express.Mime)34describe 'Express'5 describe '.mime()'6 it 'should return media type of extensions passed'5 Express.mime('jpeg').should.eql 'image/jpeg'7 Express.utilities.mime('jpeg').should.eql 'image/jpeg'8 end9 10 it 'should return application/octet-stream when invalid'9 Express.mime('foobar').should.eql 'application/octet-stream'11 Express.utilities.mime('foobar').should.eql 'application/octet-stream'12 end13 14 it 'should parse extension of basename or path passed'13 Express.mime('images/profile.png').should.eql 'image/png'14 Express.mime('foo.bar.something-else.png').should.eql 'image/png'15 Express.utilities.mime('images/profile.png').should.eql 'image/png'16 Express.utilities.mime('foo.bar.something-else.png').should.eql 'image/png'17 end18 end19end