mirror of https://gitee.com/bigwinds/arangodb
Fix windows test for Foxx socket request URL (#7536)
* Fix windows test for Foxx socket request URL * Fix unix abs path test
This commit is contained in:
parent
2e680a7f9b
commit
c74583b089
|
@ -23,7 +23,10 @@
|
|||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const parseUrl = require('url').parse;
|
||||
const {join: joinPath, resolve: resolvePath} = require('path').posix;
|
||||
const {
|
||||
posix: {join: joinPath},
|
||||
resolve: resolvePath
|
||||
} = require('path');
|
||||
const typeIs = require('type-is').is;
|
||||
const accepts = require('accepts');
|
||||
const parseRange = require('range-parser');
|
||||
|
|
|
@ -543,17 +543,20 @@ describe('SyntheticRequest', function () {
|
|||
);
|
||||
});
|
||||
it('correctly handles unix sockets', function () {
|
||||
const socketPath = require('internal').platform.substr(0, 3) === 'win'
|
||||
? "C:\\tmp\\arangod.sock"
|
||||
: "/tmp/arangod.sock";
|
||||
const rawReq = createNativeRequest({
|
||||
db: 'bananas',
|
||||
mount: '/foxx',
|
||||
path: '/some/place/special',
|
||||
search: '?a=1&b=2',
|
||||
protocol: 'https',
|
||||
socketPath: '/tmp/arangod.sock'
|
||||
socketPath
|
||||
});
|
||||
const req = new SyntheticRequest(rawReq, {mount: '/foxx'});
|
||||
expect(req.makeAbsolute('../another/place')).to.equal(
|
||||
'https://unix:/tmp/arangod.sock:/_db/bananas/another/place'
|
||||
`https://unix:${socketPath}:/_db/bananas/another/place`
|
||||
);
|
||||
});
|
||||
it('correctly handles relative unix sockets', function () {
|
||||
|
|
Loading…
Reference in New Issue