From e8fc4139a153bc78125b4d799af8b0c0c136a9db Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Mon, 31 Dec 2012 09:12:43 -0500 Subject: [PATCH] Fixed string length bug in workit-cors. --- README.md | 3 +++ package.json | 2 +- src/cli.coffee | 2 +- src/workit-cors.coffee | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2ef4c4..757d994 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,9 @@ gradients. Change Log ---------- +### 1.0.1 +- Fixed string length bug in workit-cors. + ### 1.0.0 - Changed middleware prefixes from `connect-` to `workit-` so as not to be confused with middleware of the same name by different authors. diff --git a/package.json b/package.json index 1afa54e..6272b4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workit", - "version": "1.0.0", + "version": "1.0.1", "description": "The stupid development server. Serves CoffeeScript, Jade, and Stylus like a champ. Reloads browser on source-file change. CORS enabled.", "keywords": ["assets", "compile", "cors", "live", "preprocess", "proxy", "reload", "serve", "static", "watch"], "author": "Shannon Moeller (http://shannonmoeller.com)", diff --git a/src/cli.coffee b/src/cli.coffee index b288ce4..9af71fe 100644 --- a/src/cli.coffee +++ b/src/cli.coffee @@ -5,7 +5,7 @@ commander = require 'commander' path = require 'path' # Arguments -commander.version('1.0.0') +commander.version('1.0.1') .usage('[options] [dir]') .option('-a, --address ', 'set hostname [localhost]') .option('-f, --format ', 'connect logger format [dev]', 'dev') diff --git a/src/workit-cors.coffee b/src/workit-cors.coffee index 8789702..c6fa20c 100644 --- a/src/workit-cors.coffee +++ b/src/workit-cors.coffee @@ -12,7 +12,7 @@ module.exports = (req, res, next) -> res.setHeader 'Access-Control-Allow-Headers', 'X-Requested-With' # Guard proxy requests - return next() unless req.url.slice(0, 14) is '/workit-cors/' + return next() unless req.url.slice(0, 13) is '/workit-cors/' # Parse url opts = url.parse req.url.slice(14)