Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable io.js/node 0.12 build #1468

Merged
merged 6 commits into from Mar 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions .travis.yml
@@ -1,12 +1,8 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "io.js"
matrix:
allow_failures:
- node_js: "0.12"
- node_js: "io.js"
- "0.12"
- "0.10"
after_script: ./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose
webhooks:
urls: https://webhooks.gitter.im/e/237280ed4796c19cc626
Expand Down
8 changes: 0 additions & 8 deletions README.md
Expand Up @@ -5,14 +5,6 @@
[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat)](https://coveralls.io/r/request/request)
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat)](https://gitter.im/request/request?utm_source=badge)

## !!! Does not work with Node v0.12.x !!!

We're working on this. Want to help? See the
[contribution guidelines](https://github.com/request/request/blob/master/CONTRIBUTING.md),
help us fix the
[failing tests](https://travis-ci.org/request/request/jobs/49916823),
and [submit a PR](https://github.com/request/request/pulls)!

## Super simple to use

Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,7 +41,7 @@
"isstream": "~0.1.1"
},
"scripts": {
"test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser && npm run clean",
"test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why was this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had a clean script back then, that logic was later moved to the browser test itself. NPM on node 0.10 doesn't complain about the missing script, where the newer version of it throws an error.

cc @eiriksm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it seems like this is safe to remove then. npm won't look anywhere else for scripts to run (see run).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I think the clean script removed a browserified build of the test script, but the current version browserifies the test script on the fly instead.

"test-browser": "node tests/browser/start.js",
"lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed."
},
Expand Down
5 changes: 3 additions & 2 deletions request.js
Expand Up @@ -896,17 +896,18 @@ Request.prototype.start = function () {
self.req = self.httpModule.request(reqOptions)

if (self.timeout && !self.timeoutTimer) {
var timeout = self.timeout < 0 ? 0 : self.timeout
self.timeoutTimer = setTimeout(function () {
self.abort()
var e = new Error('ETIMEDOUT')
e.code = 'ETIMEDOUT'
self.emit('error', e)
}, self.timeout)
}, timeout)

// Set additional timeout on socket - in case if remote
// server freeze after sending headers
if (self.req.setTimeout) { // only works on node 0.6+
self.req.setTimeout(self.timeout, function () {
self.req.setTimeout(timeout, function () {
if (self.req) {
self.req.abort()
var e = new Error('ESOCKETTIMEDOUT')
Expand Down
2 changes: 1 addition & 1 deletion tests/server.js
Expand Up @@ -34,7 +34,7 @@ exports.createSSLServer = function(port, opts) {
}

for (i in options) {
if (i !== 'requestCert' && i !== 'rejectUnauthorized') {
if (i !== 'requestCert' && i !== 'rejectUnauthorized' && i !== 'ciphers') {
options[i] = fs.readFileSync(options[i])
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/test-https.js
Expand Up @@ -13,6 +13,7 @@ var s = server.createSSLServer()
, caFile = path.resolve(__dirname, 'ssl/ca/ca.crt')
, ca = fs.readFileSync(caFile)
, opts = {
ciphers: 'AES256-SHA',
key: path.resolve(__dirname, 'ssl/ca/server.key'),
cert: path.resolve(__dirname, 'ssl/ca/server.crt')
}
Expand Down