http-server
Advanced tools
Comparing version 0.12.3 to 0.13.0
@@ -5,3 +5,3 @@ 'use strict'; | ||
union = require('union'), | ||
ecstatic = require('ecstatic'), | ||
httpServerCore = require('./core'), | ||
auth = require('basic-auth'), | ||
@@ -13,26 +13,2 @@ httpProxy = require('http-proxy'), | ||
// a hacky and direct workaround to fix https://github.com/http-party/http-server/issues/525 | ||
function getCaller() { | ||
try { | ||
var stack = new Error().stack; | ||
var stackLines = stack.split('\n'); | ||
var callerStack = stackLines[3]; | ||
return callerStack.match(/at (.+) \(/)[1]; | ||
} | ||
catch (error) { | ||
return ''; | ||
} | ||
} | ||
var _pathNormalize = path.normalize; | ||
path.normalize = function (p) { | ||
var caller = getCaller(); | ||
var result = _pathNormalize(p); | ||
// https://github.com/jfhbrook/node-ecstatic/blob/master/lib/ecstatic.js#L20 | ||
if (caller === 'decodePathname') { | ||
result = result.replace(/\\/g, '/'); | ||
} | ||
return result; | ||
}; | ||
// | ||
@@ -74,2 +50,3 @@ // Remark: backwards compatibility for previous | ||
this.headers = options.headers || {}; | ||
this.headers['Accept-Ranges'] = 'bytes'; | ||
@@ -155,3 +132,3 @@ this.cache = ( | ||
before.push(ecstatic({ | ||
before.push(httpServerCore({ | ||
root: this.root, | ||
@@ -166,2 +143,3 @@ cache: this.cache, | ||
contentType: this.contentType, | ||
mimetypes: options.mimetypes, | ||
handleError: typeof options.proxy !== 'string' | ||
@@ -168,0 +146,0 @@ })); |
{ | ||
"name": "http-server", | ||
"version": "0.12.3", | ||
"version": "0.13.0", | ||
"description": "A simple zero-configuration command-line http server", | ||
@@ -13,3 +13,7 @@ "main": "./lib/http-server", | ||
"command", | ||
"static", | ||
"http", | ||
"https", | ||
"http-server", | ||
"https-server", | ||
"server" | ||
@@ -19,4 +23,4 @@ ], | ||
"start": "node ./bin/http-server", | ||
"pretest": "common bin/http-server lib/ test", | ||
"test": "vows --spec --isolate" | ||
"test": "tap --reporter=spec test/*.test.js", | ||
"test-watch": "tap --reporter=spec --watch test/*.test.js" | ||
}, | ||
@@ -82,3 +86,3 @@ "files": [ | ||
"name": "Jade Michael Thornton", | ||
"email": "jade@jmthornton.net" | ||
"email": "jademichael@jmthornton.net" | ||
} | ||
@@ -90,4 +94,5 @@ ], | ||
"corser": "^2.0.1", | ||
"ecstatic": "^3.3.2", | ||
"he": "^1.1.0", | ||
"http-proxy": "^1.18.0", | ||
"mime": "^1.6.0", | ||
"minimist": "^1.2.5", | ||
@@ -97,8 +102,12 @@ "opener": "^1.5.1", | ||
"secure-compare": "3.0.1", | ||
"union": "~0.5.0" | ||
"union": "~0.5.0", | ||
"url-join": "^2.0.5" | ||
}, | ||
"devDependencies": { | ||
"common-style": "^3.0.0", | ||
"eol": "^0.9.1", | ||
"express": "^4.16.3", | ||
"mkdirp": "^0.5.0", | ||
"request": "^2.88.2", | ||
"vows": "~0.8.3" | ||
"tap": "^14.11.0" | ||
}, | ||
@@ -105,0 +114,0 @@ "bugs": { |
@@ -1,3 +0,3 @@ | ||
[![build status](https://img.shields.io/travis/http-party/http-server.svg?style=flat-square)](https://travis-ci.org/http-party/http-server) | ||
[![npm](https://img.shields.io/npm/v/http-server.svg?style=flat-square)](https://www.npmjs.com/package/http-server) [![homebrew](https://img.shields.io/homebrew/v/http-server?style=flat-square)](https://formulae.brew.sh/formula/http-server) [![npm downloads](https://img.shields.io/npm/dm/http-server?color=blue&label=npm%20downloads&style=flat-square)](https://www.npmjs.com/package/http-server) | ||
![GitHub Workflow Status (master)](https://img.shields.io/github/workflow/status/http-party/http-server/Node.js%20CI/master?style=flat-square) | ||
[![npm](https://img.shields.io/npm/v/http-server.svg?style=flat-square)](https://www.npmjs.com/package/http-server) [![homebrew](https://img.shields.io/homebrew/v/http-server?style=flat-square)](https://formulae.brew.sh/formula/http-server) ![GitHub milestone](https://img.shields.io/github/milestones/progress-percent/http-party/http-server/8?label=next%20release%20progress&style=flat-square) [![npm downloads](https://img.shields.io/npm/dm/http-server?color=blue&label=npm%20downloads&style=flat-square)](https://www.npmjs.com/package/http-server) | ||
[![license](https://img.shields.io/github/license/http-party/http-server.svg?style=flat-square)](https://github.com/http-party/http-server) | ||
@@ -45,3 +45,3 @@ | ||
`-p` or `--port` Port to use (defaults to 8080) | ||
`-p` or `--port` Port to use (defaults to 8080). Use `-p 0` to look for an open port, starting at 8080. It will also read from `process.env.PORT`. | ||
@@ -88,2 +88,4 @@ `-a` Address to use (defaults to 0.0.0.0) | ||
`--mimetypes` Path to a .types file for custom mimetype definition | ||
`-h` or `--help` Print this list and exit. | ||
@@ -90,0 +92,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117135
18
1378
150
12
6
4
2
+ Addedhe@^1.1.0
+ Addedmime@^1.6.0
+ Addedurl-join@^2.0.5
- Removedecstatic@^3.3.2
- Removedecstatic@3.3.2(transitive)