Parse task headers as HTTP headers rather than JSON

This commit is contained in:
Rowan Manning
2016-11-07 14:48:11 +00:00
committed by Rowan Manning
parent ee729d1d55
commit 568e068613
6 changed files with 24 additions and 12 deletions

View File

@@ -35,6 +35,13 @@ function presentTask(task) {
// Enhance the ignored rules
task.ignore = presentIgnoreRules(task.ignore);
// Change headers to a string format
if (task.headers && typeof task.headers === 'object') {
task.headers = Object.keys(task.headers).map(header => {
return `${header}: ${task.headers[header]}`;
}).join('\n');
}
// Present the last result if present
if (task.last_result) {
task.lastResult = presentResult(task.last_result);