Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restify

Package Overview
Dependencies
Maintainers
0
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify - npm Package Compare versions

Comparing version 0.1.18 to 0.1.19

24

lib/client.js

@@ -49,2 +49,3 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.

* a 500ms wait.
* - noContentMD5: skip content-md5 checking.
*

@@ -93,2 +94,3 @@ *

}
this.noContentMD5 = options.noContentMD5;

@@ -337,2 +339,4 @@ if (log.trace()) {

if (res.body.length !== len) {
log.trace('RestClient: %s %s, content-length mismatch',
options.method, options.path);
if (operation.retry(new Error())) return;

@@ -345,3 +349,2 @@

res.body.length,
details: res.headers
}));

@@ -351,8 +354,14 @@ }

if (res.headers['content-md5']) {
if (res.headers['content-md5'] && !self.noContentMD5) {
var hash = crypto.createHash('md5');
hash.update(res.body);
if (res.headers['content-md5'] !== hash.digest('base64')) {
var digest = hash.digest('base64');
if (res.headers['content-md5'] !== digest) {
log.trace('RestClient: %s %s, content-md5 mismatch',
options.method, options.path);
err = newError({
details: 'Content-MD5 mismatch'
httpCode: HttpCodes.InternalError,
restCode: RestCodes.InvalidHeader,
message: 'Content-MD5 ' + res.headers['content-md5'] +
' didn\'t match: ' + digest
});

@@ -390,2 +399,4 @@ if (operation.retry(err)) return;

log.trace('RestClient: %s %s: issuing callback',
options.method, options.path);
callback(null, res.statusCode, res.headers, res.params, res);

@@ -442,3 +453,8 @@ });

} else {
var headers = opts.headers;
opts._restify_extend(options);
opts.headers = headers;
if (options.headers) {
opts.headers._restify_extend(options.headers);
}
}

@@ -445,0 +461,0 @@ }

// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
module.exports = {
InternalError: 'InternalError',
InvalidArgument: 'InvalidArgument',

@@ -5,0 +6,0 @@ InvalidCredentials: 'InvalidCredentials',

2

package.json
{
"name": "restify",
"description": "REST framework specifically meant for web service APIs",
"version": "0.1.18",
"version": "0.1.19",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc