Skip to content
Browse files

fix the gzipping problem by adding another errorcode

  • Loading branch information...
1 parent 97c3bd6 commit 5272b8fe73002f86d0584f0c2648926a36ca0e41 @gero3 committed Feb 6, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 server/cloud9/middleware.js
View
7 server/cloud9/middleware.js
@@ -6,6 +6,10 @@ var connect = require("connect/lib/connect"),
path = require("path"),
utils = require("connect/lib/connect/utils");
+try {
+process.binding("constants");
+} catch(e){}
+
exports.staticProvider = function (root, mount) {
var staticGzip = exports.staticGzip({
root : path.normalize(root),
@@ -111,7 +115,8 @@ exports.staticGzip = function(options){
// Check if gzipped static is available
gzipped(filename, function(err, path, ext){
- if (err && err.errno === (process.ENOENT || require("constants").ENOENT)) {
+ if (err && (err.errno === process.ENOENT ||
+ err.errno === process.ERANGE )) {
next();
// We were looking for a gzipped static,

0 comments on commit 5272b8f

Please sign in to comment.
Something went wrong with that request. Please try again.