Guard against mime.lookup('foo.constructor') trying to return the lookup table's constructor #24

merged 3 commits into from Feb 16, 2012

2 participants


See jfhbrook/node-ecstatic#15 for a more in-depth explanation of the issue.

Thanks! ^__^


Thanks for the request! Can we inline the hasOwnProperty() check instead of defining the has() method? (Does has() really add that much value?)

if (mime.types.hasOwnProperty(ext) {

Yes, inlining it should work. I added a test, so you can check too.

@broofa broofa merged commit 39ef52a into broofa:master Feb 16, 2012
@broofa broofa added a commit that referenced this pull request Feb 16, 2012
@broofa patchup README and #24 68f653f

Oh, sweet, just discovered the "Object.create(null)" trick that creates an Object instance that doesn't inherit from Object.prototype.

See comments in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment