New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

warp-proxy

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

warp-proxy - npm Package Compare versions

Comparing version 1.3.5 to 1.4.0

13

lib/proxy-files.js

@@ -9,2 +9,7 @@ const chalk = require('chalk');

const headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'OPTIONS, POST, GET, PUT, DELETE',
};
const run = ({port, directory, fileExt = 'json', keepExtensions = true, slowMode = false}) => {

@@ -15,2 +20,8 @@ const invoke = slowMode ? withTimer : immediately;

const files = (req, res) => {
if (req.method === 'OPTIONS') {
res.writeHead(204, headers);
res.end();
return;
}
const urlFile = req.url.split('/').splice(-1).pop() || `index.${fileExt}`;

@@ -29,2 +40,4 @@ const urlFileExt = urlFile.indexOf('.') > -1 ? urlFile.split('.').splice(-1).pop() : null;

const paintedStatus = paintStatus(status);
res.writeHead(status, headers);
if (exist) {

@@ -31,0 +44,0 @@ const stream = fs.createReadStream(filePath);

2

package.json
{
"name": "warp-proxy",
"version": "1.3.5",
"version": "1.4.0",
"description": "Proxy requests or return mocks from local files instead",

@@ -5,0 +5,0 @@ "main": "index.js",

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