Compare commits
2 commits
4b3154c22c
...
d4a5ed29db
Author | SHA1 | Date | |
---|---|---|---|
d4a5ed29db | |||
fba8536743 |
2 changed files with 19 additions and 2 deletions
|
@ -121,9 +121,10 @@ export async function signedGet(_url: string, user: { id: User['id'] }): Promise
|
|||
return false;
|
||||
};
|
||||
|
||||
if (isActivitypub(res.headers.get('Content-Type'))) {
|
||||
return await res.json();
|
||||
if (!isActivitypub(res.headers.get('Content-Type'))) {
|
||||
throw new Error('invalid response content type');
|
||||
}
|
||||
return await res.json();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,20 @@ export const meta = {
|
|||
|
||||
description: 'File a report.',
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false,
|
||||
required: true,
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'misskey:id',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
errors: ['NO_SUCH_USER', 'CANNOT_REPORT_ADMIN', 'CANNOT_REPORT_YOURSELF'],
|
||||
} as const;
|
||||
|
||||
|
@ -81,4 +95,6 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||
sanitizeHtml(ps.comment));
|
||||
}
|
||||
});
|
||||
|
||||
return { id: report.id };
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue