Skip to content

Commit

Permalink
fix(deps): Upgrade connect 3.
Browse files Browse the repository at this point in the history
This means dropping support for node 0.8.

Fixes part of #1410
  • Loading branch information
dignifiedquire committed Jun 4, 2015
1 parent d5dac1f commit b490985
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_js:
- "iojs"
- "0.12"
- "0.10"
- "0.8"

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var setNoCacheHeaders = function(response) {


var setHeavyCacheHeaders = function(response) {
response.setHeader('Cache-Control', ['public', 'max-age=31536000']);
response.setHeader('Cache-Control', 'public, max-age=31536000');
};


Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var path = require('path');
var helper = require('../helper');
var log = require('../logger').create();
var constant = require('../constants');
var json = require('connect').json();
var json = require('body-parser').json();

// TODO(vojta): disable when single-run mode
var createRunnerMiddleware = function(emitter, fileList, capturedBrowsers, reporter, executor,
Expand Down
8 changes: 2 additions & 6 deletions lib/middleware/source_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

var querystring = require('querystring');
var common = require('./common');
var pause = require('connect').utils.pause;


var findByPath = function(files, path) {
Expand All @@ -29,10 +28,7 @@ var createSourceFilesMiddleware = function(filesPromise, serveFile,
.replace(/^\/absolute/, '')
.replace(/^\/base/, basePath);

// Need to pause the request because of proxying, see:
// https://groups.google.com/forum/#!topic/q-continuum/xr8znxc_K5E/discussion
// TODO(vojta): remove once we don't care about Node 0.8
var pausedRequest = pause(request);
request.pause();

This comment has been minimized.

Copy link
@shanear

shanear Oct 16, 2015

Contributor

@dignifiedquire is this still necessary? This is causing strange interactions with asynchronous functionality in lower middleware (serve-static specifically).

Thanks! :octocat:

This comment has been minimized.

Copy link
@dignifiedquire

dignifiedquire Oct 17, 2015

Author Member

I'm not a 100% sure. Why do you need serve-static for static serving karma has everything built in, no?

This comment has been minimized.

Copy link
@shanear

shanear Oct 17, 2015

Contributor

Well, it's a custom middleware that probes our back-end services and dynamically serves json files that describe the existing test data (using serve-static).

We've found a work-around, but I was just curious to why this request.pause() was necessary. Requests should hang until next() or response.end() is called, right?

It could also cause strange interactions with any other sort of asynchronous middleware further down the stack. So if it's not needed, it's probably beneficial to remove.

This comment has been minimized.

Copy link
@dignifiedquire

dignifiedquire Oct 17, 2015

Author Member

If it's not needed I'm all for removing it, this code is pretty old as you can see from the references to 0.8, so it might very well be that we can drop in. If you have time to do some investigation and find out (and let me know 😜 ) that would be great!


return filesPromise.then(function(files) {
// TODO(vojta): change served to be a map rather then an array
Expand All @@ -52,7 +48,7 @@ var createSourceFilesMiddleware = function(filesPromise, serveFile,
next();
}

pausedRequest.resume();
request.resume();
});
};
};
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@
"Jeff Lage <jefflage@me.com>"
],
"dependencies": {
"body-parser": "^1.12.4",
"chokidar": "^1.0.1",
"colors": "^1.1.0",
"connect": "^2.29.2",
"connect": "^3.3.5",
"di": "^0.0.1",
"expand-braces": "^0.1.1",
"glob": "^5.0.6",
Expand Down

0 comments on commit b490985

Please sign in to comment.