Skip to content

Commit cb01ac4

Browse files
author
CI
committed
Releasing version 0.0.85
1 parent 65f1631 commit cb01ac4

File tree

5 files changed

+240
-312
lines changed

5 files changed

+240
-312
lines changed

examples/tracing-basic/func.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const {
1515
const { HttpLogger } = require('zipkin-transport-http')
1616

1717
fdk.handle(async function (input, ctx) {
18-
var tracer = createOCITracer(ctx)
18+
const tracer = createOCITracer(ctx)
1919

20-
var result
20+
let result
2121
// Start a new 'scoped' server handling span.
2222
await tracer.scoped(async function () {
2323
// Fetch some resource
@@ -58,7 +58,7 @@ function fetchResource () {
5858
* @returns A Promise with the success or failure of the operation.
5959
*/
6060
async function someComputation (toReturn) {
61-
var i
61+
let i
6262
for (i = 0; i < 5; i++) {
6363
await simulate(1000)
6464
}

fn-fdk.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ function canonHeader (h) {
362362
const first = h.substr(0, 1)
363363
return first.toUpperCase() + last.toLowerCase()
364364
}
365+
return ''
365366
}).join('-')
366367
}
367368

@@ -444,6 +445,14 @@ class HTTPGatewayContext {
444445
this.ctx.setResponseHeader('Fn-Http-Status', status)
445446
}
446447

448+
/**
449+
* Returns the HTTP status code of the HTTP response
450+
* @returns {string}
451+
*/
452+
get statusCode () {
453+
return this.ctx.getResponseHeader('Fn-Http-Status')
454+
}
455+
447456
/**
448457
* Sets a response header to zero or more values
449458
* @param key {string}

0 commit comments

Comments
 (0)