Skip to content

Commit fbb2b08

Browse files
steven-supersolidflovilmart
authored andcommitted
ensure batch routing paths are posix (#3138)
1 parent 127629d commit fbb2b08

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
"lint": "eslint ./",
7171
"build": "babel src/ -d lib/",
7272
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 $COVERAGE_OPTION jasmine",
73-
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
73+
"test:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 jasmine",
7474
"coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/istanbul cover' npm test",
75-
"coverage:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
75+
"coverage:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 node ./node_modules/istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js",
7676
"start": "node ./bin/parse-server",
7777
"prepublish": "npm run build"
7878
},

src/batch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function makeBatchRoutingPathFunction(originalUrl, serverURL, publicServerURL) {
3232
Parse.Error.INVALID_JSON,
3333
'cannot route batch path ' + requestPath);
3434
}
35-
return path.join('/', requestPath.slice(apiPrefix.length));
35+
return path.posix.join('/', requestPath.slice(apiPrefix.length));
3636
}
3737

3838
if (serverURL && publicServerURL
@@ -44,7 +44,7 @@ function makeBatchRoutingPathFunction(originalUrl, serverURL, publicServerURL) {
4444
return function(requestPath) {
4545
// Build the new path by removing the public path
4646
// and joining with the local path
47-
let newPath = path.join('/', localPath, '/' , requestPath.slice(publicPath.length));
47+
let newPath = path.posix.join('/', localPath, '/' , requestPath.slice(publicPath.length));
4848
// Use the method for local routing
4949
return makeRoutablePath(newPath);
5050
}

0 commit comments

Comments
 (0)