Compare commits
1 Commits
preview-te
...
preview-wi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acc3599f1b |
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@@ -2,4 +2,4 @@
|
|||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { RateLimitOptions } from '@server/utils/rateLimit';
|
import type { RateLimitOptions } from '@server/utils/rateLimit';
|
||||||
import rateLimit from '@server/utils/rateLimit';
|
// import rateLimit from '@server/utils/rateLimit';
|
||||||
import type NodeCache from 'node-cache';
|
import type NodeCache from 'node-cache';
|
||||||
|
|
||||||
// 5 minute default TTL (in seconds)
|
// 5 minute default TTL (in seconds)
|
||||||
@@ -26,11 +26,12 @@ class ExternalAPI {
|
|||||||
params: Record<string, string> = {},
|
params: Record<string, string> = {},
|
||||||
options: ExternalAPIOptions = {}
|
options: ExternalAPIOptions = {}
|
||||||
) {
|
) {
|
||||||
if (options.rateLimit) {
|
// if (options.rateLimit) {
|
||||||
this.fetch = rateLimit(fetch, options.rateLimit);
|
// this.fetch = rateLimit(fetch, options.rateLimit);
|
||||||
} else {
|
// } else {
|
||||||
this.fetch = fetch;
|
// this.fetch = fetch;
|
||||||
}
|
// }
|
||||||
|
this.fetch = fetch;
|
||||||
|
|
||||||
const url = new URL(baseUrl);
|
const url = new URL(baseUrl);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logger from '@server/logger';
|
import logger from '@server/logger';
|
||||||
import type { RateLimitOptions } from '@server/utils/rateLimit';
|
import type { RateLimitOptions } from '@server/utils/rateLimit';
|
||||||
import rateLimit from '@server/utils/rateLimit';
|
// import rateLimit from '@server/utils/rateLimit';
|
||||||
import { createHash } from 'crypto';
|
import { createHash } from 'crypto';
|
||||||
import { promises } from 'fs';
|
import { promises } from 'fs';
|
||||||
import mime from 'mime/lite';
|
import mime from 'mime/lite';
|
||||||
@@ -150,13 +150,14 @@ class ImageProxy {
|
|||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
this.key = key;
|
this.key = key;
|
||||||
|
|
||||||
if (options.rateLimitOptions) {
|
// if (options.rateLimitOptions) {
|
||||||
this.fetch = rateLimit(fetch, {
|
// this.fetch = rateLimit(fetch, {
|
||||||
...options.rateLimitOptions,
|
// ...options.rateLimitOptions,
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
this.fetch = fetch;
|
// this.fetch = fetch;
|
||||||
}
|
// }
|
||||||
|
this.fetch = fetch;
|
||||||
this.headers = options.headers || null;
|
this.headers = options.headers || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user