Socket
Socket
Sign inDemoInstall

@google-cloud/functions-framework

Package Overview
Dependencies
64
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.3.2

2

build/src/index.js

@@ -75,3 +75,3 @@ #!/usr/bin/env node

}
const SERVER = invoker_1.getServer(USER_FUNCTION, SIGNATURE_TYPE, TARGET);
const SERVER = invoker_1.getServer(USER_FUNCTION, SIGNATURE_TYPE);
const ERROR_HANDLER = new invoker_1.ErrorHandler(SERVER);

@@ -78,0 +78,0 @@ SERVER.listen(PORT, () => {

@@ -112,2 +112,2 @@ /// <reference types="node" />

*/
export declare function getServer(userFunction: HandlerFunction, functionSignatureType: SignatureType, functionTarget: string): http.Server;
export declare function getServer(userFunction: HandlerFunction, functionSignatureType: SignatureType): http.Server;

@@ -346,5 +346,5 @@ "use strict";

*/
function registerFunctionRoutes(app, userFunction, functionTarget, functionSignatureType) {
function registerFunctionRoutes(app, userFunction, functionSignatureType) {
if (isHttpFunction(userFunction, functionSignatureType)) {
app.use(`/${functionTarget}`, (req, res, next) => {
app.use('/*', (req, res, next) => {
onFinished(res, (err, res) => {

@@ -355,3 +355,3 @@ res.locals.functionExecutionFinished = true;

});
app.all(`/${functionTarget}`, (req, res, next) => {
app.all('/*', (req, res, next) => {
const handler = makeHttpHandler(userFunction);

@@ -362,3 +362,3 @@ handler(req, res, next);

else {
app.post(`/${functionTarget}`, (req, res, next) => {
app.post('/*', (req, res, next) => {
const wrappedUserFunction = wrapEventFunction(userFunction);

@@ -413,7 +413,7 @@ const handler = makeHttpHandler(wrappedUserFunction);

*/
function getServer(userFunction, functionSignatureType, functionTarget) {
function getServer(userFunction, functionSignatureType) {
// App to use for function executions.
const app = express();
// Set request-specific values in the very first middleware.
app.use(`/${functionTarget}`, (req, res, next) => {
app.use('/*', (req, res, next) => {
latestRes = res;

@@ -430,3 +430,3 @@ res.locals.functionExecutionFinished = false;

app.use(bodyParser.raw(rawBodySavingOptions));
registerFunctionRoutes(app, userFunction, functionTarget, functionSignatureType);
registerFunctionRoutes(app, userFunction, functionSignatureType);
app.enable('trust proxy'); // To respect X-Forwarded-For header.

@@ -433,0 +433,0 @@ return http.createServer(app);

@@ -7,2 +7,18 @@ # Changelog

## v1.3.2
09-13-2019 18:06 PDT
- Revert "fixes [#33](https://github.com/GoogleCloudPlatform/functions-framework-nodejs/pull/33): Only listen to functionTarget. ([#81](https://github.com/GoogleCloudPlatform/functions-framework-nodejs/pull/81))"
### Implementation Changes
### New Features
### Dependencies
### Documentation
### Internal / Testing Changes
## v1.3.1

@@ -9,0 +25,0 @@

{
"name": "@google-cloud/functions-framework",
"version": "1.3.1",
"version": "1.3.2",
"description": "FaaS (Function as a service) framework for writing portable Node.js functions",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc