Socket
Socket
Sign inDemoInstall

autohost

Package Overview
Dependencies
Maintainers
6
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autohost - npm Package Compare versions

Comparing version 0.5.8 to 0.5.9

6

CHANGELOG.md
## 0.5.x
### 0.5.9
* Better default error logging for 5xx errors
* Minor tweak to prevent posting two timing metrics for resource actions called via HTTP
### 0.5.8

@@ -8,3 +12,3 @@ * Add differentiated handle feature (to support adding versioned handlers in hyped)

* Fixed issue with data objects having no hasOwnProperty function
* Fixed issue with data objects having no hasOwnProperty function

@@ -11,0 +15,0 @@ ### 0.5.6

2

package.json
{
"name": "autohost",
"version": "0.5.8",
"version": "0.5.9",
"description": "Resource driven, transport agnostic host",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -298,6 +298,3 @@ var path = require( 'path' );

req._action = actionName;
var timer = meta.getTimer();
res.once( 'finish', function() {
timer.record( { name: 'HTTP_API_DURATION' } );
} );
req._timer = meta.getTimer();
action.handle = getHandler( action.handle );

@@ -304,0 +301,0 @@ respond( state, meta, req, res, resource, action );

@@ -6,2 +6,3 @@ var request;

var metrics = require( '../metrics' )();
var log = require( '../log' )( 'autohost.http.envelope' );

@@ -138,5 +139,8 @@ function HttpEnvelope( req, res, metricKey ) {

this.exceptions.record( 1, { name: 'HTTP_API_EXCEPTIONS' } );
var user = _.isObject( this.user ) ? ( this.user.name || this.user.username || this.user.id ) : 'anonymous';
log.error( '%s [%s] %s\n%s', process.title, user, this.url || '', error.stack || error.name || '' );
} else {
this.errors.record( 1, { name: 'HTTP_API_ERRORS' } );
}
var filePath = strategy.file ? path.resolve( host.static, strategy.file ) : '';

@@ -143,0 +147,0 @@ if ( fs.existsSync( filePath ) ) {

@@ -110,4 +110,4 @@ var _ = require( 'lodash' );

var url = req.url;
var elapsed = timer.record( { name: 'HTTP_REQUEST_DURATION' } );
var elapsed;
var metricKey = req._metricKey;

@@ -121,2 +121,3 @@ if ( metricKey ) {

resourceEgress.record( sent, { name: 'HTTP_API_EGRESS' } );
elapsed = req._timer.record( { name: 'HTTP_API_DURATION' } );
} else {

@@ -129,2 +130,3 @@ var httpRequests = state.metrics.meter( [ urlKey, 'requests' ] );

httpEgress.record( sent, { name: 'HTTP_EGRESS' } );
elapsed = timer.record( { name: 'HTTP_REQUEST_DURATION' } );
}

@@ -131,0 +133,0 @@

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