Skip to content

Commit

Permalink
Fix skywalking s3 upload error #8824 (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwen5 authored May 19, 2022
1 parent 9db0ca2 commit 92fe2ad
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/plugins/HttpPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,21 @@ class HttpPlugin implements SwPlugin {

if (idxCallback) arguments[idxCallback] = responseCB;

let arg0 = arguments[0];
const expect = arg0.headers && (arg0.headers.Expect || arg0.headers.expect);

if (expect === '100-continue') {
span.inject().items.forEach((item) => {
arg0.headers[item.key] = item.value;
});
}

const req: ClientRequest = _request.apply(this, arguments);

span.inject().items.forEach((item) => req.setHeader(item.key, item.value));
span
.inject()
.items.filter((item) => expect != '100-continue')
.forEach((item) => req.setHeader(item.key, item.value));

wrapEmit(span, req, true, 'close');

Expand Down

0 comments on commit 92fe2ad

Please sign in to comment.