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

testcafe-hammerhead

Package Overview
Dependencies
Maintainers
1
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-hammerhead - npm Package Compare versions

Comparing version 0.1.1 to 0.2.1

lib/pipeline/xhr/headers.js

5

lib/const.js

@@ -19,9 +19,6 @@ exports.__esModule = true;

CONST.HOVER_PSEUDO_CLASS_ATTR = 'data-hammerhead-hovered';
CONST.FOCUS_PSEUDO_CLASS_ATTR = 'data-hammerhead-focused';
CONST.DOCUMENT_CHARSET = 'hammerhead|document-charset';
CONST.XHR_CORS_SUPPORTED_FLAG = 0x10;
CONST.XHR_REQUEST_MARKER_HEADER = 'hammerhead|xhr-request-marker-header';
CONST.XHR_WITH_CREDENTIALS_FLAG = 0x01;
CONST.SHADOW_UI_CLASSNAME_POSTFIX = '-hammerhead-shadow-ui';

@@ -28,0 +25,0 @@ CONST.SHADOW_UI_CHARSET_CLASSNAME = 'charset' + CONST.SHADOW_UI_CLASSNAME_POSTFIX;

10

lib/pipeline/header-transforms.js
var _Object$keys = require('babel-runtime/core-js/object/keys').default;
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;
var _interopRequireWildcard = require('babel-runtime/helpers/interop-require-wildcard').default;

@@ -12,2 +14,6 @@

var _xhrHeaders = require('./xhr/headers');
var _xhrHeaders2 = _interopRequireDefault(_xhrHeaders);
var _utilsUrl = require('../utils/url');

@@ -17,4 +23,2 @@

var _const = require('../const');
var _url = require('url');

@@ -43,3 +47,3 @@

}, _requestTransforms[_const.XHR_REQUEST_MARKER_HEADER] = skip, _requestTransforms);
}, _requestTransforms[_xhrHeaders2.default.requestMarker] = skip, _requestTransforms);

@@ -46,0 +50,0 @@ var requestForced = {

@@ -28,3 +28,3 @@ var _regeneratorRuntime = require('babel-runtime/regenerator').default;

var _sameOriginPolicy = require('./same-origin-policy');
var _xhrSameOriginPolicy = require('./xhr/same-origin-policy');

@@ -74,3 +74,3 @@ var _utilsHttp = require('../utils/http');

2: function checkSameOriginPolicyCompliance(ctx, next) {
if (ctx.isXhr && !_sameOriginPolicy.check(ctx)) {
if (ctx.isXhr && !_xhrSameOriginPolicy.check(ctx)) {
ctx.closeWithError(0);

@@ -77,0 +77,0 @@ return;

var _classCallCheck = require('babel-runtime/helpers/class-call-check').default;
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;
var _interopRequireWildcard = require('babel-runtime/helpers/interop-require-wildcard').default;
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;
exports.__esModule = true;
var _xhrHeaders = require('./xhr/headers');
var _xhrHeaders2 = _interopRequireDefault(_xhrHeaders);
var _charset = require('./charset');
var _charset2 = _interopRequireDefault(_charset);
var _utilsUrl = require('../utils/url');

@@ -17,8 +25,2 @@

var _const = require('../const');
var _charset = require('./charset');
var _charset2 = _interopRequireDefault(_charset);
//TODO rewrite parseProxyUrl instead

@@ -74,3 +76,3 @@ function flattenParsedProxyUrl(parsed) {

this.isXhr = !!req.headers[_const.XHR_REQUEST_MARKER_HEADER];
this.isXhr = !!req.headers[_xhrHeaders2.default.requestMarker];
this.isPage = !this.isXhr && acceptHeader && contentUtils.isPage(acceptHeader);

@@ -122,3 +124,3 @@ }

this.isXhr = !!this.req.headers[_const.XHR_REQUEST_MARKER_HEADER];
this.isXhr = !!this.req.headers[_xhrHeaders2.default.requestMarker];
this.isPage = !this.isXhr && acceptHeader && contentUtils.isPage(acceptHeader);

@@ -125,0 +127,0 @@ this.isIFrame = this.dest.resourceType === urlUtils.IFRAME;

@@ -10,2 +10,4 @@ exports.__esModule = true;

var wrappedMethods = {
querySelector: true,
querySelectorAll: true,
postMessage: true,

@@ -12,0 +14,0 @@ write: true,

@@ -57,2 +57,3 @@ var _inherits = require('babel-runtime/helpers/inherits').default;

this.proxy = null;
this.pageLoadCount = 0;
this.injectable = {

@@ -102,5 +103,6 @@ scripts: ['/hammerhead.js'],

return _mustache2.default.render(TASK_TEMPLATE, {
var taskScript = _mustache2.default.render(TASK_TEMPLATE, {
cookie: cookies.replace(/'/g, "\\'"),
sessionId: this.id,
isFirstPageLoad: this.pageLoadCount === 0,
serviceMsgUrl: serverInfo.domain + '/messaging',

@@ -112,2 +114,6 @@ ie9FileReaderShimUrl: serverInfo.domain + '/ie9-file-reader-shim',

});
this.pageLoadCount++;
return taskScript;
};

@@ -114,0 +120,0 @@

{
"name": "testcafe-hammerhead",
"description": "A powerful web-proxy used as a core for the TestCafe testing framework (https://github.com/superroma/testcafe-phoenix).",
"version": "0.1.1",
"version": "0.2.1",
"homepage": "https://github.com/superroma/testcafe-hammerhead",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/superroma/testcafe-hammerhead/issues",

@@ -6,1 +6,5 @@ # testcafe-hammerhead

[![Sauce Test Status](https://saucelabs.com/browser-matrix/testcafe-hammerhead.svg)](https://saucelabs.com/u/testcafe-hammerhead)
[![Health Monitor](https://testcafe-hhhm.devexpress.com/badge/last-commit.svg)](https://testcafe-hhhm.devexpress.com)

Sorry, the diff of this file is too big to display

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

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

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