diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index b1e34eef55..382eb24bbd 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -1,7 +1,9 @@ import Boom = require('boom'); -Boom.wrap(new Error('test'), 400, 'some message'); +var bo = Boom.wrap(new Error('test'), 400, 'some message'); +var a: string = bo.output.headers['some header']; + Boom.create(500, 'Internal server error', { timestamp: Date.now() }); Boom.badRequest('message', {some: 'data'}); diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 38edfd2d4b..863e2deafc 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -29,11 +29,8 @@ declare namespace Boom { export interface Output { /** statusCode - the HTTP status code (typically 4xx or 5xx). */ statusCode: number; - /** - * headers - an object containing any HTTP headers where each key is a header name and value is the header content. - * TODO can we limit value type any to string? - */ - headers: {[index: string]: any}; + /** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */ + headers: {[index: string]: string}; /** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */ payload: { /** statusCode - the HTTP status code, derived from error.output.statusCode. */