Comparing version 0.3.6 to 0.3.7
@@ -360,6 +360,4 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
message: 'Maximum number of retries exceeded: ' + attempt, | ||
details: { | ||
headers: res.headers, | ||
body: res.body | ||
} | ||
headers: res.headers, | ||
details: res.body | ||
})); | ||
@@ -382,3 +380,5 @@ } | ||
message: 'Content-Length ' + len + ' didn\'t match: ' + | ||
res.body.length | ||
res.body.length, | ||
headers: res.headers, | ||
details: res.body | ||
})); | ||
@@ -399,3 +399,5 @@ } | ||
message: 'Content-MD5 ' + res.headers['content-md5'] + | ||
' didn\'t match: ' + digest | ||
' didn\'t match: ' + digest, | ||
headers: res.headers, | ||
details: res.body | ||
}); | ||
@@ -418,3 +420,5 @@ if (operation.retry(err)) return; | ||
message: 'Content-Type was JSON, but it\'s not parsable', | ||
error: e | ||
error: e, | ||
headers: res.headers, | ||
details: res.body | ||
})); | ||
@@ -421,0 +425,0 @@ } |
@@ -14,2 +14,3 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
* - message {String} Human Message. | ||
* - headers {Object} extra HTTP headers. | ||
* - error {Error} Exception. | ||
@@ -44,2 +45,3 @@ * - details {Object} Whatever you want. | ||
if (options.details) e.details = options.details; | ||
if (options.headers) e.headers = options.headers; | ||
@@ -46,0 +48,0 @@ return e; |
@@ -10,2 +10,3 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
BadRequest: 400, | ||
NotAuthorized: 401, | ||
Forbidden: 403, | ||
@@ -12,0 +13,0 @@ NotFound: 404, |
@@ -159,3 +159,3 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
this.send(error.httpCode, _e); | ||
this.send(error.httpCode, _e, error.headers); | ||
this.errorSent = true; | ||
@@ -162,0 +162,0 @@ this.emit('errorSent'); |
@@ -92,3 +92,13 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
_stdout.write(req.connection.remoteAddress + ' - ' + | ||
// HTTP and HTTPS are different -> joyent/node GH #1005 | ||
var addr = req.connection.remoteAddress; | ||
if (!addr) { | ||
if (req.connection.socket) { | ||
addr = req.connection.socket.remoteAddress; | ||
} else { | ||
addr = 'unknown'; | ||
} | ||
} | ||
_stdout.write(addr + ' - ' + | ||
(req.username ? req.username : ' -') + ' [' + | ||
@@ -95,0 +105,0 @@ _pad(d.getUTCDate()) + '/' + |
@@ -80,7 +80,14 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
for (var i = 0; i < params.length; i++) { | ||
var _url = url.parse(components[i]); | ||
if (params[i] === _url.pathname) continue; | ||
// Don't use URL.parse, as it doesn't handle strings | ||
// with ':' in them for this case. Regardless of what the | ||
// RFC says about this, people do it. | ||
var frag = components[i]; | ||
if (frag.indexOf('?') !== -1) | ||
frag = frag.split('?', 2)[0]; | ||
if (params[i] === frag) | ||
continue; | ||
if (params[i].charAt(0) === ':') { | ||
parsed[params[i].substr(1)] = _url.pathname; | ||
parsed[params[i].substr(1)] = frag; | ||
continue; | ||
@@ -87,0 +94,0 @@ } |
{ | ||
"name": "restify", | ||
"description": "REST framework specifically meant for web service APIs", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"repository": { | ||
@@ -12,7 +12,7 @@ "type": "git", | ||
"dependencies": { | ||
"formidable": ">=1.0.2", | ||
"httpu": ">=0.0.1", | ||
"node-uuid": ">=1.1.0", | ||
"retry": ">=0.4.0", | ||
"semver": ">=1.0.6" | ||
"formidable": "1.0.2", | ||
"httpu": "0.0.1", | ||
"node-uuid": "1.2.0", | ||
"retry": "0.4.0", | ||
"semver": "1.0.8" | ||
}, | ||
@@ -34,9 +34,8 @@ "scripts": { | ||
"devDependencies": { | ||
"jshint": ">=0.2.1", | ||
"node-uuid": ">=1.2.0", | ||
"whiskey": ">=0.3.3" | ||
"jshint": "0.2.3", | ||
"whiskey": "0.4.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.4.0" | ||
"node": "~0.4" | ||
} | ||
} |
@@ -253,3 +253,2 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
assert.equal(err.message, 'Maximum number of retries exceeded: 2'); | ||
assert.ok(err.details); | ||
test.finish(); | ||
@@ -256,0 +255,0 @@ }); |
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
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
207845
2
3910
+ Addedformidable@1.0.2(transitive)
+ Addedhttpu@0.0.1(transitive)
+ Addednode-uuid@1.2.0(transitive)
+ Addedretry@0.4.0(transitive)
+ Addedsemver@1.0.8(transitive)
- Removedasap@2.0.6(transitive)
- Removeddezalgo@1.0.4(transitive)
- Removedformidable@3.5.2(transitive)
- Removedhexoid@2.0.0(transitive)
- Removedhttpu@1.0.1(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedonce@1.4.0(transitive)
- Removedretry@0.13.1(transitive)
- Removedsemver@7.6.3(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedformidable@1.0.2
Updatedhttpu@0.0.1
Updatednode-uuid@1.2.0
Updatedretry@0.4.0
Updatedsemver@1.0.8