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

angular-mock-record

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-mock-record - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "angular-mock-record",
"version": "1.0.6",
"version": "1.0.7",
"description": "An angular / protractor framework that mocks and records requests. Requests can be manually mocked or recorded like VCR.",

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

@@ -9,7 +9,9 @@ class Http {

get(req) {
return new Promise((resolve, reject) => {
this.http.get(
{
json: true,
url: this.config.domain + req.url
url: this.config.domain + req.url,
jar: true,
headers: this.setRequestHeaders(req.headers)
}, (error, response, body) => {

@@ -31,2 +33,12 @@

setRequestHeaders(requestHeaders) {
let out = {};
this.config.request_headers.forEach(header => {
out[header] = requestHeaders[header];
});
return out;
}
setCorsHeaders(req, res) {

@@ -33,0 +45,0 @@ res.header('Access-Control-Allow-Origin', req.headers.origin);

@@ -15,5 +15,10 @@ const express = require('express');

this.app.use((req, res) => {
req.url = this.rewritePathToMocks(req.url);
this.requestHandler.handle(req, res);
});
}
rewritePathToMocks(url) {
return url.replace(config.proxied_mock_server_route, '');
}
}

@@ -20,0 +25,0 @@

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