File tree Expand file tree Collapse file tree 5 files changed +240
-312
lines changed
Expand file tree Collapse file tree 5 files changed +240
-312
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ const {
1515const { HttpLogger } = require ( 'zipkin-transport-http' )
1616
1717fdk . 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 */
6060async function someComputation ( toReturn ) {
61- var i
61+ let i
6262 for ( i = 0 ; i < 5 ; i ++ ) {
6363 await simulate ( 1000 )
6464 }
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments