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

koa-spdy-push

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-spdy-push - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

1

index.js

@@ -43,2 +43,3 @@

&& (typeof length !== 'number' || length > threshold)
&& !headers['content-encoding']
&& filter(headers['content-type'])

@@ -45,0 +46,0 @@ if (compress)

6

package.json
{
"name": "koa-spdy-push",
"description": "SPDY Push helper for Koa",
"version": "0.1.4",
"version": "0.1.5",
"author": {

@@ -21,5 +21,7 @@ "name": "Jonathan Ong",

"co": "3",
"mz": "*",
"koa": "*",
"raw-body": "*",
"mocha": "*",
"should": "*",
"should": "3",
"supertest": "*",

@@ -26,0 +28,0 @@ "spdy": "1",

@@ -8,2 +8,4 @@

var join = require('path').join
var zlib = require('mz/zlib')
var get = require('raw-body')
var koa = require('koa')

@@ -162,3 +164,27 @@ var fs = require('fs')

describe('Buffers', function () {
describe('when already compress', function () {
it('should not compress', co(function* () {
yield listen(koa().use(function* () {
this.status = 204
push({
threshold: 1
})(this, {
path: '/',
headers: {
'content-encoding': 'gzip',
'content-type': 'text/plain'
},
body: yield zlib.gzip('lol')
})
}))
var res = yield pull
res.should.have.header('Content-Encoding', 'gzip')
res.should.have.header('Content-Type', 'text/plain')
var buffer = yield get(res)
buffer.toString('utf8').should.equal('lol')
}))
})
})

@@ -197,5 +223,5 @@

.once('response', function (res) {
if (res.statusCode !== 204) done(new Error('wtf'))
if (res.statusCode !== 204) done(new Error('got status code: ' + res.statusCode))
})
.end()
}
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