mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-07 22:57:16 +09:00
Fix: cause 500 when no url (#129)
This commit is contained in:
parent
749e776d6f
commit
f45c802a7f
@ -5,6 +5,11 @@ import summaly from '../';
|
|||||||
const app = new Koa();
|
const app = new Koa();
|
||||||
|
|
||||||
app.use(async ctx => {
|
app.use(async ctx => {
|
||||||
|
if (!ctx.query.url) {
|
||||||
|
ctx.status = 400;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const summary = await summaly(ctx.query.url, {
|
const summary = await summaly(ctx.query.url, {
|
||||||
followRedirects: false
|
followRedirects: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user