Skip to content

Commit

Permalink
Version 3.1.1 (#52)
Browse files Browse the repository at this point in the history
* refactor code to use new context class, better code style

* improve cookie validation

* getting configurations from server, more refactoring

* adjust tests

* code formatting fix

* use staging config service location

* removed trailing slash from service location

* renamed the uuid in the whole project to use one convention, fixed module not sending page_requested from s2s, fixed module not extracting details from s2s when score was under blockscore, added client_uuid to page_requested

* disable when no configurations

* Updated the readme file

* error massages, fetching configs disabled by default

* test

* undo interval change

* fixed merge errors

* removed block template config

* code style fixes

* Added module mode support

* small changes to config

* Updated readme for module mode support

* Updated readme

small fix in readme

* Update README.md

evald -> evaluated

* ip headers as list

* validate ips

* added pass_reason to page_requested

* added 3 pass reasons

* added risk_ttl

* added initializer for risk_rtt

* small visual changes

* started additional activity handler

* removed unneeded quotes

* fixed enum

* Added additional activity handler

* refactor valudation, replaced customBlockHandler with customRequestHandler, added missing pass_reasons

* small refactor

* first version of travis file

* testing travis again

* updated gitignore

* updated tests

* fixed failing tests

* removed unneeded console.log

* Update README.md

* reverted UA

* removed unneeded console.log

* removed unneeded console.log

* added cookieOrigin to ctx

* issue with block reason fixed

* fixed failing tests

* removed lodash dependency

* changed remote config path

* working with shared base

* only set interval when in dynamic conf mode

* using new client class

* removed unused function

* fixed integration tests

* moved some tests around

* update dependencies

* added instructions for captcha provider in readme

* added monitorMode to readme

* added header support for mobile

* upgraded moment package

* tests fix

* bump version

* added changes to changelog

* upgraded express

* update travis yml

* added istanbul coverage

* small fix for response handling

* refactor to middleware

* more refactoring

* small refactors to readme and package.json

* Update perimeterx.js

* bump version

* added npmignore

* small refactor to enforce (#51)

* Version 3.1.1
  • Loading branch information
Johnny Tordgeman authored Jan 24, 2018
1 parent bda9420 commit 9426230
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.1] - 2018-01-24
### Modified
- Stability related fixes

## [3.1.0] - 2018-01-22
### Added

## [3.1.0] - 2018-01-22
### Added
- First party support
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[PerimeterX](http://www.perimeterx.com) Express.js Middleware
=============================================================

> Latest stable version: [v3.1.0](https://www.npmjs.com/package/perimeterx-node-express)
> Latest stable version: [v3.1.1](https://www.npmjs.com/package/perimeterx-node-express)
Table of Contents
-----------------
Expand Down
7 changes: 5 additions & 2 deletions lib/perimeterx.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function parseCookies(req, res) {
*/
function pxMiddleware(req, res, next) {
parseCookies(req, res).then(() => {
enforcer.enforce(req, res, (response) => {
enforcer.enforce(req, res, (err, response) => {
if (err) {
res.send(err);
}
if (response) { //block
res.status(response.status);
if (response.header) {
Expand All @@ -60,7 +63,7 @@ function pxMiddleware(req, res, next) {
res.setHeader(header, response.headers[header]);
}
}
res.end(response.body);
res.send(response.body);
} else { //pass
next();
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "perimeterx-node-express",
"version": "3.1.0",
"version": "3.1.1",
"description": "PerimeterX Express.js middleware to monitor and block traffic according to PerimeterX risk score",
"main": "index.js",
"directories": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"cookie-parser": "^1.4.1",
"moment": "^2.19.3",
"perimeterx-node-core": "~1.1.0"
"perimeterx-node-core": "~1.1.3"
},
"devDependencies": {
"express": "4.16.2",
Expand Down

0 comments on commit 9426230

Please sign in to comment.