next-image-transformer 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/createImageTransformRouteHandler.d.ts +13 -3
- package/dist/index.js +279 -257
- package/package.json +1 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
export declare const createImageTransformRouteHandler: ({ apiRouteUrl, cacheDir, cacheControl, }: {
|
|
1
|
+
export declare const createImageTransformRouteHandler: ({ apiRouteUrl, cacheDir, cacheControl, allowedHosts, }: {
|
|
2
2
|
apiRouteUrl: string;
|
|
3
|
-
cacheDir
|
|
4
|
-
cacheControl
|
|
3
|
+
cacheDir?: string;
|
|
4
|
+
cacheControl?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Optional allowlist for the `source` URL's host.
|
|
7
|
+
*
|
|
8
|
+
* - Exact matches: `"images.example.com"`
|
|
9
|
+
* - Host + port: `"localhost:3000"`
|
|
10
|
+
* - RegExp: `/^(?:.+\\.)?example\\.com$/` (tested against hostname and host)
|
|
11
|
+
*
|
|
12
|
+
* If omitted, all hosts are allowed (current behavior).
|
|
13
|
+
*/
|
|
14
|
+
allowedHosts?: Array<string | RegExp>;
|
|
5
15
|
}) => (req: Request) => Promise<Response>;
|