Giter VIP home page Giter VIP logo

connect-gzip's People

Contributors

dougwilson avatar marcenuc avatar nateps avatar papandreou avatar respectthecode avatar shimondoodkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

connect-gzip's Issues

wrong logic for causing it not to gzip

In lib/gzip.js, line 67,68

if ( code !== 200 || !~accept.indexOf('gzip') || !matchType.test(type) || encoding)

should perhaps have been

if ( code !== 200 || ~accept.indexOf('gzip') || !matchType.test(type) || encoding)

since !~accept.indexOf means found?

`res.writeHead(303, { Location: foreignUrl })` does not work correctly with `connect.session(...)`

Stumbled on this while looking into a reported issue with everyauth.

The problem is that the session is not properly persisted just before the redirect. To reproduce:

  1. Use the following gist
  2. Go to http://localhost:3000
  3. This should redirect to http://google.com
  4. Then, go to http://localhost:3000/two
  5. The step 2 session and step 4 session should carry the same name, but they do not -- hence, the broken assertion in the gist.

--Brian

staticGzip exposes internal fs path when a directory is accessed

My config:

app.use(gzip.staticGzip(__dirname + '/static',{maxAge: 8640000000}));

When a directory instead of an actual file is requested (without trailing slash), the staticGzip provider exposes the internal path of this directory (e.g. /home/node/myfaultyproject/static/js) to the client via a 301 Response

connect.static doesn't do that... :-)

Problem. It is not working with Node 0.4.12

connect-gzip is not working with npm install in Node.0.4.12

It said "UNMET DEPENDENCY"

said it is not compatible with my version of node/npm but I'm using the Node.0.4.12 npm 1.0.93

I don't want to run this on Unstable Node 0.5 version. anyway I can make it run on 0.4.12?

gzip an image file

Hello,

I'm getting some an error when I try to run a gulp script with gulp-connect and connect-gzip.
The problem is when I try to gzip an image file, the image is gziped and sent to the browser, but the server crashes.

This is my code:

const connect = require('gulp-connect'),
      connectGzip = require('connect-gzip');

gulp.task('connect', function() {
  connect.server({
    root: 'public',
    livereload: false,
    port: 8080,
    middleware: () => {
      return [
        connectGzip.gzip({ matchType: /text|javascript|json|image/ })
      ];
    }
  });
});

This is the error:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: write after end
    at ServerResponse.write (_http_outgoing.js:443:15)
    at Socket.<anonymous> (/Users/user/project/node_modules/connect-gzip/lib/gzip.js:93:15)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:551:20)

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node/7.3.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `./node_modules/gulp/bin/gulp.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script './node_modules/gulp/bin/gulp.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the project package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/gulp/bin/gulp.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls project
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/user/project/npm-debug.log

Can anyone help me with this problem? It's a bug?

connect-gzip doesn't work with connect >= 2.3.7

In connect 2.3.7 the send function was split into a separate module (senchalabs/connect@3ea7fa2), which breaks connect-gzip. This is unfortunate because connect-gzip specifies a very liberal version range in package.json, so all fresh installs of connect-gzip are broken right now.

My recommendation is to pin the connect dependency at a specific version:

   "dependencies": {
-    "connect": ">=1 <2",
+    "connect": "=2.3.6",
     "mime": ">=0.0.1"
   },

... then release a new version of connect-gzip asap.

Then later when we're ready to use the new connect API, we can pin it at whatever is the latest version at that point. It's a little more housekeeping, but much safer.

And yes, this just bit me upon upgrading a production server :/

Cannot handle spaces in path

I was running connect-gzip from a directory that has a space in one of its parent dirs, and that makes the exec commands fail.

The code should use an arguments array instead of a string for executing CLI tools like rm or gzip so that the arguments don't get processed by sh.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.