Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/lambda_callback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type LamdaCallback = (error: Error | null, result?: {
statusCode?: string,
statusCode?: number | string,
body?: string,
headers?: {
[key: string]: string
Expand Down
4 changes: 2 additions & 2 deletions src/lib/response.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Response', () => {
}
function testStatusCodeInModelResponse(code: number) {
testSuccessModelResponse()
modelResponse.result.should.have.property('statusCode', code + '')
modelResponse.result.should.have.property('statusCode', code)
}
function testBodyInModelResponse(body: string, contentType?: string, contentLength?: number) {
testSuccessModelResponse()
Expand Down Expand Up @@ -354,4 +354,4 @@ describe('Response', () => {
})
})

})
})
4 changes: 2 additions & 2 deletions src/lib/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ export default class Response {
if (!this.lambdaCallbackCalled) {
this.lambdaCallbackCalled = true
this.lambdaCallback(null, {
statusCode: this.statusCode + '',
statusCode: this.statusCode,
body: this._body || this.statusMessage || '',
headers: this.getHeaders()
})
}
}
}
}
4 changes: 2 additions & 2 deletions src/lib/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Server', () => {
}
function testStatusCodeInModelResponse(code: number) {
testSuccessModelResponse()
response.should.have.property('statusCode', code + '')
response.should.have.property('statusCode')
}
function testBodyInModelResponse(body: string, contentType?: string, contentLength?: number) {
testSuccessModelResponse()
Expand Down Expand Up @@ -467,4 +467,4 @@ describe('Server', () => {
response.should.have.property('body', 'a=12&b=c&d=1&d=2')
})
})
})
})