@fnproject/fdk 0.0.37 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/fn-fdk.js +3 -2
  2. package/package.json +1 -1
package/fn-fdk.js CHANGED
@@ -27,6 +27,7 @@ const fdkVersion = 'fdk-node/' + version.version + ' (njsv=' + runtimeVersion +
27
27
  const runtimeTag = 'node/' + runtimeVersion.substr(1, runtimeVersion.length - 1)
28
28
 
29
29
  const fnFunctionExceptionMessage = 'Exception in function, consult logs for details'
30
+ const fnFunctionBadRequestErrorMessage = 'Bad request'
30
31
 
31
32
  /**
32
33
  * The function handler - This is a user-supplied node function that implements the behaviour of the current fn function
@@ -277,7 +278,7 @@ function handleHTTPStream (fnfunction, options) {
277
278
  const inputHandler = getInputHandler(inputMode)
278
279
 
279
280
  if (req.method !== 'POST' || req.url !== '/call') {
280
- sendJSONError(resp, 400, { message: 'Invalid method', detail: `${req.method} ${req.url}` })
281
+ sendJSONError(resp, 400, { message: 'Invalid method', detail: fnFunctionBadRequestErrorMessage })
281
282
  return
282
283
  }
283
284
 
@@ -326,7 +327,7 @@ function handleHTTPStream (fnfunction, options) {
326
327
  sendJSONError(resp, 502, { message: fnFunctionExceptionMessage, detail: error.toString() })
327
328
  })
328
329
  }).on('error', (e) => {
329
- sendJSONError(resp, 500, { message: 'Error sending response', detail: `${req.method} ${req.url} ${e.toString()}` })
330
+ sendJSONError(resp, 500, { message: 'Error sending response', detail: `${e.toString()}` })
330
331
  })
331
332
  }
332
333
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fnproject/fdk",
3
- "version": "0.0.37",
3
+ "version": "0.0.41",
4
4
  "description": "Function Developer Kit for Fn",
5
5
  "main": "fn-fdk.js",
6
6
  "scripts": {