Skip to content

Commit

Permalink
Merge pull request #1349 from eiriksm/bug/error-on-browser-error
Browse files Browse the repository at this point in the history
Make sure we return on errored browser requests.
  • Loading branch information
nylen committed Jan 13, 2015
2 parents 5d515b0 + 4d9e7da commit 9564f99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"main": "index.js",
"dependencies": {
"bl": "~0.9.0",
"caseless": "~0.8.0",
"caseless": "~0.9.0",
"forever-agent": "~0.5.0",
"form-data": "~0.2.0",
"json-stringify-safe": "~5.0.0",
Expand Down
13 changes: 12 additions & 1 deletion tests/browser/test.js
Expand Up @@ -13,7 +13,18 @@ var assert = require('assert')
, tape = require('tape')
, request = require('../../index')

tape('Request browser test', function(t) {
tape('returns on error', function(t) {
t.plan(1)
request({
uri: 'https://stupid.nonexistent.path:port123/\\<-great-idea',
withCredentials: false
}, function (error, response) {
t.equal(response.statusCode, 0)
t.end()
})
})

tape('succeeds on valid URLs (with https and CORS)', function(t) {
t.plan(1)
request({
uri: 'https://localhost:6767',
Expand Down

0 comments on commit 9564f99

Please sign in to comment.