Skip to content

Commit

Permalink
Merge pull request sintaxi#502 from sintaxi/release-v0.20.0
Browse files Browse the repository at this point in the history
Release v0.20.0
  • Loading branch information
kennethormandy committed Nov 16, 2015
2 parents 0a61866 + 3bb5f2a commit bcd6809
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: false
language: node_js
node_js:
- "0.12"
- "4.2"
- "5.0"
28 changes: 28 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "{build}"
os: Windows Server 2012 R2

# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "0.12"
- nodejs_version: "4.2"
- nodejs_version: "5.0"

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install

# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- npm test

# Don't actually build or deploy.
build: off
deploy: off
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ exports.pipeline = function(root){
var charset = mime.charsets.lookup(mimeType)
rsp.statusCode = 200
rsp.setHeader('Content-Type', mimeType + (charset ? '; charset=' + charset : ''))
rsp.setHeader('Content-Length', body.length)
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.end(body)
})

Expand Down
14 changes: 7 additions & 7 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ var custom200static = function(req, rsp, next){
var type = helpers.mimeType("html")
var charset = mime.charsets.lookup(type)
rsp.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''))
rsp.setHeader('Content-Length', body.length)
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.statusCode = 200
rsp.end(body)
}else{
Expand Down Expand Up @@ -200,7 +200,7 @@ var custom200dynamic = function(req, rsp, next){
var type = helpers.mimeType("html")
var charset = mime.charsets.lookup(type)
rsp.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
rsp.setHeader('Content-Length', body.length);
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.statusCode = 200;
rsp.end(body)
}
Expand All @@ -226,7 +226,7 @@ var custom404static = function(req, rsp, next){
var type = helpers.mimeType("html")
var charset = mime.charsets.lookup(type)
rsp.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''))
rsp.setHeader('Content-Length', body.length)
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.statusCode = 404
rsp.end(body)
}else{
Expand Down Expand Up @@ -260,7 +260,7 @@ var custom404dynamic = function(req, rsp, next){
var type = helpers.mimeType("html")
var charset = mime.charsets.lookup(type)
rsp.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
rsp.setHeader('Content-Length', body.length);
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.statusCode = 404;
rsp.end(body)
}
Expand All @@ -287,7 +287,7 @@ var default404 = function(req, rsp, next){
var charset = mime.charsets.lookup(type)
rsp.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
rsp.statusCode = 404
rsp.setHeader('Content-Length', body.length);
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.end(body)
})
}
Expand Down Expand Up @@ -512,7 +512,7 @@ exports.process = function(req, rsp, next){
var body = helpers.cssError(locals)
rsp.statusCode = 200
rsp.setHeader('Content-Type', mimeType + (charset ? '; charset=' + charset : ''))
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset))
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.end(body)
}else{

Expand All @@ -528,7 +528,7 @@ exports.process = function(req, rsp, next){
var charset = mime.charsets.lookup(mimeType)
rsp.statusCode = 500
rsp.setHeader('Content-Type', mimeType + (charset ? '; charset=' + charset : ''))
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset))
rsp.setHeader('Content-Length', Buffer.byteLength(body, charset));
rsp.end(body)
})
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harp",
"version": "0.19.0",
"version": "0.20.0",
"description": "Static web server with built in preprocessing",
"author": "Brock Whitten <[email protected]>",
"contributors":
Expand Down Expand Up @@ -45,7 +45,7 @@
"parseurl": "1.3.0",
"pause": "0.1.0",
"send": "0.13.0",
"terraform": "0.12.1"
"terraform": "0.13.2"
},
"devDependencies": {
"cheerio": "0.19.0",
Expand All @@ -62,6 +62,6 @@
"readmeFilename": "README.md",
"bin": "./bin/harp",
"engines": {
"node": ">=0.10"
"node": ">=0.12"
}
}

0 comments on commit bcd6809

Please sign in to comment.