Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for now.js crashing when the object prototype has been extended #133

Closed
wants to merge 1 commit into from

2 participants

Benjamin Lupton Steve Wang
Benjamin Lupton

As the title says. Can this be pulled asap, as it is preventing one of my projects from being worked on. I know that object prototypes should not be extended, however there are always exceptions.

Steve Wang

Apologies for the delay.

Steve Wang steveWang closed this
Benjamin Lupton

Cheers, has it been published to npm?

Steve Wang

Indeed it has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/fileServer.js
8 lib/fileServer.js
View
@@ -34,13 +34,17 @@ handleResponse = function (request, response) {
} else {
// Make sure default listeners are still handled
for (i in defaultListeners) {
- defaultListeners[i].call(server, request, response);
+ if ( defaultListeners.hasOwnProperty(i) ) {
+ defaultListeners[i].call(server, request, response);
+ }
}
}
} else {
for (i in defaultListeners) {
// Make sure default listeners are still handled
- defaultListeners[i].call(server, request, response);
+ if ( defaultListeners.hasOwnProperty(i) ) {
+ defaultListeners[i].call(server, request, response);
+ }
}
}
};
Something went wrong with that request. Please try again.