mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-07-01 15:49:59 +09:00
feat: add oEmbed support (#6)
* feat: add oEmbed support * more safelisted features * fix the syntax * Update README.md * permissions * names * playerを使うように * fix type error * support width (for size ratio) * test for type: video * nullable width * restore max height test * ignored permissions * restore autoplay * Use WHATWG URL --------- Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
committed by
GitHub
parent
51f3870e1f
commit
eab3766db9
@ -84,14 +84,15 @@ async function getResponse(args) {
|
||||
limit: 0,
|
||||
},
|
||||
});
|
||||
return await receiveResponce({ req, typeFilter: args.typeFilter });
|
||||
return await receiveResponse({ req, typeFilter: args.typeFilter });
|
||||
}
|
||||
async function receiveResponce(args) {
|
||||
async function receiveResponse(args) {
|
||||
const req = args.req;
|
||||
const maxSize = MAX_RESPONSE_SIZE;
|
||||
req.on('response', (res) => {
|
||||
// Check html
|
||||
if (args.typeFilter && !res.headers['content-type']?.match(args.typeFilter)) {
|
||||
// console.warn(res.headers['content-type']);
|
||||
req.cancel(`Rejected by type filter ${res.headers['content-type']}`);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user