Fix crash in legacy service (#2437)

Bug in #2360
This commit is contained in:
Paul Melnikow
2018-12-01 15:10:32 -05:00
committed by GitHub
parent 54a36e9474
commit 0aee712738
2 changed files with 5 additions and 1 deletions

View File

@@ -74,6 +74,10 @@ function flattenQueryParams(queryParams) {
//
// Pass just the handler function as shorthand.
function handleRequest(cacheHeaderConfig, handlerOptions) {
if (!cacheHeaderConfig) {
throw Error('cacheHeaderConfig is required')
}
if (typeof handlerOptions === 'function') {
handlerOptions = { handler: handlerOptions }
}