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

gith

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gith - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

lib/gith.js

@@ -13,2 +13,3 @@ /*

var _ = require("lodash");
var querystring = require("querystring");

@@ -235,3 +236,3 @@ var filterSettings = function( settings, payload ) {

if ( /^payload=/.test( data ) ) {
var payload = JSON.parse( data.slice(8) );
var payload = JSON.parse( querystring.unescape(data.slice(8)) );
eventaur.emit( "payload", payload );

@@ -238,0 +239,0 @@ }

{
"name": "gith",
"description": "gith[ooks] - a simple node server that responds to github post-receive events with meaningful data",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/danheberden/gith",

@@ -6,0 +6,0 @@ "author": {

var githFactory = require('../lib/gith.js');
var http = require('http');
var _ = require('lodash');
var querystring = require('querystring');

@@ -97,3 +98,3 @@ /*

},
'gith creates a server and listens to payloads on that port': function( test ) {
'gith creates a server and listens to unescaped payloads on that port': function( test ) {
test.expect(1);

@@ -127,2 +128,32 @@ var gith = githFactory.create( 9001 );

request.end();
},
'gith creates a server and listens to escaped payloads on that port': function( test ) {
test.expect(1);
var gith = githFactory.create( 9001 );
var payloadObject = require('./payloads/add-file-and-dir.json');
var failSafe = false;
gith().on( 'all', function( payload ) {
failSafe = true;
test.equal( payload.original.after, payloadObject.after, "payload data should equal sent payload data" );
gith.close();
test.done();
});
// just incase
setTimeout( function() {
if ( !failSafe ) {
gith.close();
test.ok( false, 'payload event never fired after 200ms, shutting down server' );
test.done();
}
}, 200 );
var request = http.request({
port: 9001,
host: 'localhost',
method: 'POST'
});
request.write( 'payload=' + querystring.escape( JSON.stringify( payloadObject ) ) );
request.end();
}

@@ -129,0 +160,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