Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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

@balupton

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.

@steveWang

Apologies for the delay.

@steveWang steveWang closed this
@balupton

Cheers, has it been published to npm?

@steveWang

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
View
8 lib/fileServer.js
@@ -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.