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

azure-function-express

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-function-express - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

25

lib/createIncomingMessage.js

@@ -14,8 +14,28 @@ "use strict";

const NOOP = () => {};
const NOOP = () => {}; /* eslint-disable no-underscore-dangle */
function removePortFromAddress(address) {
return address ? address.replace(/:[0-9]*$/, "") : address;
}
/**
* Create a fake connection object
*
* @param {Object} context Azure context object for a single HTTP request.
* @returns {object} Connection object
*/
function createConnectionObject(context) {
const req = context.bindings.req;
const xForwardedFor = req.headers ? req.headers["x-forwarded-for"] : undefined;
return {
encrypted: req.originalUrl && req.originalUrl.toLowerCase().startsWith("https"),
remoteAddress: removePortFromAddress(xForwardedFor)
};
}
/**
* @private
*/
/* eslint-disable no-underscore-dangle */
class IncomingMessage extends _events2.default {

@@ -39,2 +59,3 @@

this.socket = { destroy: NOOP };
this.connection = createConnectionObject(context);

@@ -41,0 +62,0 @@ // Extra content

6

package.json
{
"name": "azure-function-express",
"version": "1.0.0",
"version": "1.1.0",
"description": "Allows Express usage with Azure Function",

@@ -89,6 +89,6 @@ "keywords": [

"babel-register": "^6.18.0",
"eslint": "^3.10.2",
"eslint": "^3.11.1",
"eslint-config-airbnb-base": "^10.0.1",
"eslint-plugin-import": "^2.2.0",
"mocha": "^3.1.2",
"mocha": "^3.2.0",
"nyc": "^8.4.0-candidate",

@@ -95,0 +95,0 @@ "rewire": "^2.5.2",

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