Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
// splats are available for rewriting match.to, but not accessible on
// the request object (couchdb 1.1.x), storing in a separate variable
// for now
var splat = exports.rewriteSplat(match.from, url);
var to = exports.replaceGroups(match.to, query, splat);
var req = {
method: method,
query: query,
headers: {},
path: to.split('/'),
client: true,
initial_hit: utils.initial_hit,
cookie: cookies.readBrowserCookies()
};
if (data) {
req.form = data;
}
db.newUUID(100, function (err, uuid) {
if (err) {
return callback(err);
}
req.uuid = uuid;
if (utils.userCtx) {
req.userCtx = utils.userCtx;
return callback(null, req);
}
else {
}
}
}
// splats are available for rewriting match.to, but not accessible on
// the request object (couchdb 1.1.x), storing in a separate variable
// for now
var splat = exports.rewriteSplat(match.from, url);
var to = exports.replaceGroups(match.to, query, splat);
var req = {
method: method,
query: query,
headers: {},
path: to.split('/'),
client: true,
initial_hit: utils.initial_hit,
cookie: cookies.readBrowserCookies()
};
if (data) {
req.form = data;
}
db.newUUID(100, function (err, uuid) {
if (err) {
return callback(err);
}
req.uuid = uuid;
if (utils.userCtx) {
req.userCtx = utils.userCtx;
return callback(null, req);
}
else {
db.newUUID(100, function (err, uuid) {
if (err) {
return callback(err);
}
callback(null, {
userCtx: userCtx,
uuid: uuid,
method: 'GET',
query: {},
headers: {},
path: ['_session'],
client: true,
initial_hit: utils.initial_hit,
cookie: cookies.readBrowserCookies()
});
});
};