Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@netlify/ipx

Package Overview
Dependencies
Maintainers
19
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/ipx - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

16

dist/http.d.ts

@@ -7,8 +7,10 @@ import type { HandlerResponse } from '@netlify/functions';

}
export declare function loadSourceImage({ cacheDir, url, requestEtag, modifiers, isLocal }: {
cacheDir: any;
url: any;
requestEtag: any;
modifiers: any;
isLocal: any;
}): Promise<SourceImageResult>;
export interface SourceImageOptions {
cacheDir: string;
url: string;
requestHeaders?: Record<string, string>;
modifiers: string;
isLocal?: boolean;
requestEtag?: string;
}
export declare function loadSourceImage({ cacheDir, url, requestEtag, modifiers, isLocal, requestHeaders }: SourceImageOptions): Promise<SourceImageResult>;

@@ -35,3 +35,3 @@ "use strict";

const GATEWAY_ERROR = 502;
async function loadSourceImage({ cacheDir, url, requestEtag, modifiers, isLocal }) {
async function loadSourceImage({ cacheDir, url, requestEtag, modifiers, isLocal, requestHeaders = {} }) {
const fileCache = (0, path_1.join)(cacheDir, 'cache');

@@ -46,3 +46,3 @@ const metadataCache = (0, path_1.join)(cacheDir, 'metadata');

const inputCacheFile = (0, path_1.join)(fileCache, cacheKey);
const headers = new node_fetch_1.Headers();
const headers = new node_fetch_1.Headers(requestHeaders);
let sourceMetadata;

@@ -49,0 +49,0 @@ if ((0, fs_extra_1.existsSync)(inputCacheFile)) {

@@ -24,2 +24,3 @@ "use strict";

let id = decodeURIComponent(segments.join('/'));
const requestHeaders = {};
const isLocal = !id.startsWith('http');

@@ -30,2 +31,8 @@ if (isLocal) {

else {
if (event.headers.cookie) {
requestHeaders.cookie = event.headers.cookie;
}
if (event.headers.authorization) {
requestHeaders.authorization = event.headers.authorization;
}
if (typeof domains === 'string') {

@@ -56,3 +63,4 @@ domains = domains.split(',').map(s => s.trim());

modifiers,
isLocal
isLocal,
requestHeaders
});

@@ -59,0 +67,0 @@ if (response) {

{
"name": "@netlify/ipx",
"version": "0.0.5",
"version": "0.0.6",
"description": "on-demand image optimization for Netlify",

@@ -36,2 +36,3 @@ "repository": "netlify/netlify-ipx",

"@types/fs-extra": "^9.0.12",
"@types/node-fetch": "^2.0.0",
"eslint": "^7.29.0",

@@ -38,0 +39,0 @@ "jiti": "^1.10.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc