|
|
@ -22,11 +22,7 @@ module.exports = {
|
|
|
|
ctx.body = paste.paste;
|
|
|
|
ctx.body = paste.paste;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
ctx.throw(404, 'Paste Not Found', {
|
|
|
|
ctx.throw(404, 'Paste Not Found');
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -52,11 +48,7 @@ module.exports = {
|
|
|
|
// Ignore
|
|
|
|
// Ignore
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
ctx.throw(400, 'Error Processing Request Body', {
|
|
|
|
ctx.throw(400, 'Bad Paste Body');
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -66,11 +58,7 @@ module.exports = {
|
|
|
|
ctx.request.body.expire = ctx.request.body.expire * ctx.request.body.multiplier;
|
|
|
|
ctx.request.body.expire = ctx.request.body.expire * ctx.request.body.multiplier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
ctx.throw(400, 'Error Processing Paste Expiry', {
|
|
|
|
ctx.throw(400, 'Bad Paste Expiry');
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Raw request body
|
|
|
|
// Raw request body
|
|
|
@ -81,11 +69,7 @@ module.exports = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!ctx.request.body.paste) {
|
|
|
|
if (!ctx.request.body.paste) {
|
|
|
|
ctx.throw(400, 'Error No Paste Provided', {
|
|
|
|
ctx.throw(400, 'No Paste Provided');
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// /?expire=xxx
|
|
|
|
// /?expire=xxx
|
|
|
@ -106,11 +90,7 @@ module.exports = {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
await paste.save();
|
|
|
|
await paste.save();
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
ctx.throw(500, 'Error Storing Paste', {
|
|
|
|
ctx.throw(500, 'Internal Storage Error');
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// /?highlight=xxx
|
|
|
|
// /?highlight=xxx
|
|
|
|