diff --git a/lib/ngoverrides.js b/lib/ngoverrides.js
index <HASH>..<HASH> 100644
--- a/lib/ngoverrides.js
+++ b/lib/ngoverrides.js
@@ -432,7 +432,7 @@ function registerModule(context) {
                                         if (isJSONP) {
                                             // Assume everything up to the opening paren is the callback name
                                             resStr = resStr.replace(/^[^(]+\(/, '')
-                                                           .replace(/\);?$/, '');
+                                                           .replace(/\)\s*;?\s*$/, '');
                                         }
                                         // Call the callback before endRequest, to give the
                                         // callback a chance to push more requests into the queue
Allow for trailing whitespace in JSON-P response