Added global flag to path replace function in handleRequest to allow more than one...
authorJaap Karan Singh Dua <jksdua@gmail.com>
Tue, 5 Jun 2012 11:06:48 +0000 (21:06 +1000)
committerIgor Minar <igor@angularjs.org>
Thu, 18 Oct 2012 06:15:05 +0000 (23:15 -0700)
scripts/web-server.js

index 1ff37b3..d560e4a 100755 (executable)
@@ -86,7 +86,7 @@ StaticServlet.MimeMap = {
 
 StaticServlet.prototype.handleRequest = function(req, res) {
   var self = this;
-  var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/, function(match, hex){
+  var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/g, function(match, hex){
     return String.fromCharCode(parseInt(hex, 16));
   });
   var parts = path.split('/');