Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 39c4b04

Browse files
committed
Don't set content-type header on finding upload
Some system seem to be using these in their signiture checks Minio: Doesn't check DigitalOcean: Doesn't check GCP: Does check
1 parent 8ef9021 commit 39c4b04

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

parser-sdk/nodejs/parser-wrapper.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,27 @@ async function main() {
8989

9090
console.log(`Uploading results to the file storage service`);
9191

92-
await axios.put(resultUploadUrl, findingsWithIds).catch(function(error) {
93-
if (error.response) {
94-
// The request was made and the server responded with a status code
95-
// that falls out of the range of 2xx
96-
console.error(
97-
`Finding Upload Failed with Response Code: ${error.response.status}`
98-
);
99-
console.error(`Error Response Body: ${error.response.data}`);
100-
} else if (error.request) {
101-
console.error(
102-
"No response received from FileStorage when uploading finding"
103-
);
104-
console.error(error);
105-
} else {
106-
// Something happened in setting up the request that triggered an Error
107-
console.log("Error", error.message);
108-
}
109-
process.exit(1);
110-
});
92+
await axios
93+
.put(resultUploadUrl, findingsWithIds, { headers: { "content-type": "" } })
94+
.catch(function(error) {
95+
if (error.response) {
96+
// The request was made and the server responded with a status code
97+
// that falls out of the range of 2xx
98+
console.error(
99+
`Finding Upload Failed with Response Code: ${error.response.status}`
100+
);
101+
console.error(`Error Response Body: ${error.response.data}`);
102+
} else if (error.request) {
103+
console.error(
104+
"No response received from FileStorage when uploading finding"
105+
);
106+
console.error(error);
107+
} else {
108+
// Something happened in setting up the request that triggered an Error
109+
console.log("Error", error.message);
110+
}
111+
process.exit(1);
112+
});
111113

112114
console.log(`Completed parser`);
113115
}

0 commit comments

Comments
 (0)