Skip to content

Commit

Permalink
[console] proxy 'Warning' header from es
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Mar 24, 2017
1 parent d0aec25 commit 5e932e4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/core_plugins/console/server/proxy_route.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ export const createProxyRoute = ({
return reply(err);
}

if (method.toUpperCase() === 'HEAD') {
return reply(`${esResponse.statusCode} - ${esResponse.statusMessage}`)
.type('text/plain')
.code(esResponse.statusCode);
if (method.toUpperCase() !== 'HEAD') {
reply(esResponse)
.code(esResponse.statusCode)
.header('warning', esResponse.headers.warning);
return;
}

return reply(esResponse)
.code(esResponse.statusCode);
reply(`${esResponse.statusCode} - ${esResponse.statusMessage}`)
.code(esResponse.statusCode)
.type('text/plain')
.header('warning', esResponse.headers.warning);
});
}
}
Expand Down

0 comments on commit 5e932e4

Please sign in to comment.