Socket
Socket
Sign inDemoInstall

@vendia/serverless-express

Package Overview
Dependencies
0
Maintainers
5
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.3.8 to 4.3.9

2

package.json
{
"name": "@vendia/serverless-express",
"version": "4.3.8",
"version": "4.3.9",
"description": "This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using your existing Node.js application framework.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -0,4 +1,40 @@

const url = require('url')
const { getRequestValuesFromEvent, getMultiValueHeaders } = require('../utils')
const getRequestValuesFromAlbEvent = ({ event }) => getRequestValuesFromEvent({ event })
function getPathWithQueryStringUseUnescapeParams ({
event,
// NOTE: Use `event.pathParameters.proxy` if available ({proxy+}); fall back to `event.path`
path = (event.pathParameters && event.pathParameters.proxy && `/${event.pathParameters.proxy}`) || event.path,
// NOTE: Strip base path for custom domains
stripBasePath = '',
replaceRegex = new RegExp(`^${stripBasePath}`)
}) {
const query = {}
// decode everything back into utf-8 text.
if (event.multiValueQueryStringParameters) {
for (const key in event.multiValueQueryStringParameters) {
const formattedKey = decodeURIComponent(key)
query[formattedKey] = event.multiValueQueryStringParameters[key].map(value => decodeURIComponent(value))
}
} else {
for (const key in event.queryStringParameters) {
const formattedKey = decodeURIComponent(key)
query[formattedKey] = decodeURIComponent(event.queryStringParameters[key])
}
}
return url.format({
pathname: path.replace(replaceRegex, ''),
query
})
}
const getRequestValuesFromAlbEvent = ({ event }) => {
const values = getRequestValuesFromEvent({
event,
path: getPathWithQueryStringUseUnescapeParams({ event })
})
return values
}
const getResponseToAlb = ({

@@ -5,0 +41,0 @@ statusCode,

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc