Skip to content

Commit

Permalink
Drop support for Node.js 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 13, 2021
1 parent a7eb68c commit e9ff7d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 33 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
name:
- Node.js 0.8
- Node.js 0.10
- Node.js 0.12
- io.js 1.x
Expand All @@ -28,11 +27,6 @@ jobs:
- Node.js 13.x

include:
- name: Node.js 0.8
node-version: "0.8"
npm-i: mocha@2.5.3 supertest@1.1.0
npm-rm: nyc

- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.0
Expand Down Expand Up @@ -110,21 +104,11 @@ jobs:
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
nvm install --alias=npm 0.10
nvm use ${{ matrix.node-version }}
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
npm config set strict-ssl false
fi
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
- name: Configure npm
run: npm config set shrinkwrap false

- name: Remove npm module(s) ${{ matrix.npm-rm }}
run: npm rm --silent --save-dev ${{ matrix.npm-rm }}
if: matrix.npm-rm != ''

- name: Install npm module(s) ${{ matrix.npm-i }}
run: npm install --save-dev ${{ matrix.npm-i }}
if: matrix.npm-i != ''
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
@@ -1,6 +1,7 @@
1.x
===

* Drop support for Node.js 0.8
* Remove `from` alias to `root` -- use `root` directly
* Remove `send.etag()` -- use `etag` in `options`
* Remove `send.index()` -- use `index` in `options`
Expand Down
18 changes: 2 additions & 16 deletions index.js
Expand Up @@ -539,7 +539,7 @@ SendStream.prototype.send = function send (path, stat) {
var ranges = req.headers.range
var offset = options.start || 0

if (headersSent(res)) {
if (res.headersSent) {
// impossible to send now
this.headersAlreadySent()
return
Expand Down Expand Up @@ -936,7 +936,7 @@ function getHeaderNames (res) {
/**
* Determine if emitter has listeners of a given type.
*
* The way to do this check is done three different ways in Node.js >= 0.8
* The way to do this check is done three different ways in Node.js >= 0.10
* so this consolidates them into a minimal set using instance methods.
*
* @param {EventEmitter} emitter
Expand All @@ -953,20 +953,6 @@ function hasListeners (emitter, type) {
return count > 0
}

/**
* Determine if the response headers have been sent.
*
* @param {object} res
* @returns {boolean}
* @private
*/

function headersSent (res) {
return typeof res.headersSent !== 'boolean'
? Boolean(res._header)
: res.headersSent
}

/**
* Normalize the index option into an array.
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -50,7 +50,7 @@
"index.js"
],
"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10"
},
"scripts": {
"lint": "eslint .",
Expand Down

0 comments on commit e9ff7d9

Please sign in to comment.