Skip to content

Commit

Permalink
Don't use system path separators when computing URL paths.
Browse files Browse the repository at this point in the history
Fixes issue 7065.
  • Loading branch information
jleyba committed Apr 12, 2014
1 parent 9936a72 commit 8c423f2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions javascript/node/selenium-webdriver/lib/test/fileserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ var Pages = (function() {


var Path = {
BASIC_AUTH: path.join(WEB_ROOT, 'basicAuth'),
MANIFEST: path.join(WEB_ROOT, 'manifest'),
REDIRECT: path.join(WEB_ROOT, 'redirect'),
PAGE: path.join(WEB_ROOT, 'page'),
SLEEP: path.join(WEB_ROOT, 'sleep'),
UPLOAD: path.join(WEB_ROOT, 'upload')
BASIC_AUTH: WEB_ROOT + '/basicAuth',
MANIFEST: WEB_ROOT + '/manifest',
REDIRECT: WEB_ROOT + '/redirect',
PAGE: WEB_ROOT + '/page',
SLEEP: WEB_ROOT + '/sleep',
UPLOAD: WEB_ROOT + '/upload'
};


Expand Down Expand Up @@ -451,7 +451,11 @@ exports.url = server.url.bind(server);
* @throws {Error} If the server is not running.
*/
exports.whereIs = function(filePath) {
return server.url(path.join(WEB_ROOT, filePath));
filePath = filePath.replace(/\\/g, '/');
if (!string.startsWith(filePath, '/')) {
filePath = '/' + filePath;
}
return server.url(WEB_ROOT + filePath);
};


Expand Down

0 comments on commit 8c423f2

Please sign in to comment.