mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-22 14:54:22 +01:00
reqmeister: middleware/cache, reqmeister, nip05, unfurl, refactor some code
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { TTLCache, unfurl } from '@/deps.ts';
|
||||
import { Debug, TTLCache, unfurl } from '@/deps.ts';
|
||||
import { Time } from '@/utils/time.ts';
|
||||
import { fetchWorker } from '@/workers/fetch.ts';
|
||||
|
||||
const debug = Debug('ditto:unfurl');
|
||||
|
||||
interface PreviewCard {
|
||||
url: string;
|
||||
title: string;
|
||||
@@ -20,7 +22,7 @@ interface PreviewCard {
|
||||
}
|
||||
|
||||
async function unfurlCard(url: string, signal: AbortSignal): Promise<PreviewCard | null> {
|
||||
console.log(`Unfurling ${url}...`);
|
||||
debug(`Unfurling ${url}...`);
|
||||
try {
|
||||
const result = await unfurl(url, {
|
||||
fetch: (url) => fetchWorker(url, { signal }),
|
||||
|
||||
Reference in New Issue
Block a user