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

connect-body-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-body-rewrite - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/accept.js

26

Gruntfile.js

@@ -1,4 +0,5 @@

module.exports = function(grunt) {
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.loadNpmTasks('grunt-release');

@@ -8,3 +9,3 @@

jshint: {
all: ['index.js'],
all: ['index.js', 'Gruntfile.js', 'test/**.js'],
options: {

@@ -16,12 +17,27 @@ jshintrc: '.jshintrc'

watch: {
options: {
atBegin: true
},
all: {
files: ['index.js'],
tasks: ['build']
files: ['index.js', 'test/**.js'],
tasks: ['test']
}
},
mochacli: {
spec: {
options: {
files: 'test/**.js',
reporter: 'spec',
slow: 2000,
timeout: 10000,
}
}
}
});
grunt.registerTask('default', ['build']);
grunt.registerTask('default', ['test']);
grunt.registerTask('build', ['jshint']);
grunt.registerTask('package', ['build', 'release']);
grunt.registerTask('test', ['build', 'mochacli']);
};

6

index.js

@@ -74,6 +74,4 @@ 'use strict';

if (buffers[uid][res._rewriteId]) {
if (buffers[uid][res._rewriteId] && options.accept(res)) {
string = buffers[uid][res._rewriteId].buffer.join('');
delete buffers[uid][res._rewriteId];
string = options.rewrite(string);

@@ -83,2 +81,4 @@

sendHeaders();
delete buffers[uid][res._rewriteId];
}

@@ -85,0 +85,0 @@

{
"name": "connect-body-rewrite",
"version": "0.0.2",
"version": "0.0.3",
"description": "Rewrite request bodies.",
"main": "index.js",
"scripts": {
"test": "grunt build"
"test": "grunt test"
},

@@ -20,6 +20,9 @@ "keywords": [

"devDependencies": {
"express": "~3.4.4",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-mocha-cli": "~1.3.0",
"grunt-release": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.7.1"
"supertest": "~0.8.1"
},

@@ -26,0 +29,0 @@ "homepage": "https://github.com/rubenv/connect-body-rewrite",

@@ -5,2 +5,4 @@ # connect-body-rewrite - middleware to rewrite response bodies.

[![Build Status](https://travis-ci.org/rubenv/connect-body-rewrite.png?branch=master)](https://travis-ci.org/rubenv/connect-body-rewrite)
This plugin allows you to write middleware methods that process the response

@@ -7,0 +9,0 @@ body of a call.

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