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.5 to 0.1.6

25

index.js

@@ -7,3 +7,2 @@

var fs = require('fs')
var co = require('co')

@@ -17,9 +16,3 @@ module.exports = function (compressOptions) {

var _push = co(push)
return function (context, options) {
_push(context, options, context.onerror)
}
function* push(context, options) {
return function push(context, options) {
// koa properties

@@ -42,3 +35,3 @@ var res = context.res

// check whether to compress the stream
var length = yield* contentLength()
var length = contentLength()
var compress = (body || filename)

@@ -99,9 +92,7 @@ && (typeof length !== 'number' || length > threshold)

function* contentLength() {
function contentLength() {
if (filename) {
// already set
if (headers['content-length']) return parseInt(headers['content-length'], 0)
// causing spdy issues because it occurs on next tick
// return (yield stat(filename)).size
return false
if (!headers['content-length']) return false
return parseInt(headers['content-length'], 10)
}

@@ -124,8 +115,2 @@

// function stat(filename) {
// return function (done) {
// fs.stat(filename, done)
// }
// }
function filterError(err) {

@@ -132,0 +117,0 @@ if (err == null) return

{
"name": "koa-spdy-push",
"description": "SPDY Push helper for Koa",
"version": "0.1.5",
"version": "0.1.6",
"author": {

@@ -16,4 +16,3 @@ "name": "Jonathan Ong",

"dethroy": "1",
"bytes": "0",
"co": "3"
"bytes": "1"
},

@@ -20,0 +19,0 @@ "devDependencies": {

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