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

mock-responses

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-responses - npm Package Compare versions

Comparing version 1.1.10 to 1.2.0

2

package.json
{
"name": "mock-responses",
"version": "1.1.10",
"version": "1.2.0",
"description": "espress-kind http request middleware",

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

@@ -9,3 +9,2 @@ 'use strict;'

// -------------------------- Migration start -----------------------

@@ -34,2 +33,25 @@ // . add res_delay_sec column

// Parse a cookie header
function parseCookies(str) {
var obj = {};
var pairs = str.split(/; */);
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i];
var eq_idx = pair.indexOf('=');
// skip things that don't look like key=value
if (eq_idx < 0) {
continue;
} else {
var key = pair.substr(0, eq_idx).trim()
var val = pair.substr(++eq_idx, pair.length).trim();
('"' == val[0]) && (val = val.slice(1, -1));
obj[key] = val;
}
}
return obj;
}
function getHTML(templatePath, data) {

@@ -56,3 +78,3 @@ const contents = fs.readFileSync(path.join(__dirname, 'admin-ui', templatePath), 'utf8');

}
sql += ' ORDER BY updated_at DESC';
sql += ' ORDER BY req_url, updated_at DESC';
return db.prepare(sql).all();

@@ -230,4 +252,6 @@ }

let sql, ejsPath, data;
if (reqUrl.pathname === '/developer/mock-responses.html') {
const cookies = parseCookies(req.headers.cookie);
if (cookies['mock-responses'] === undefined) {
html = 'Unauthorized login';
} else if (reqUrl.pathname === '/developer/mock-responses.html') {
data = getMockResponses(reqUrl.query.q);

@@ -234,0 +258,0 @@ html = getHTML('mock-responses.ejs.html', {data});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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