Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 39 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/binding-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"client-oauth2": "^4.2.5",
"eventsource": "^2.0.2",
"find-my-way": "^8.2.2",
"node-fetch": "^2.6.7",
"node-fetch": "^2.7.0",
"query-string": "^7.1.1",
"rxjs": "5.5.11",
"slugify": "^1.4.5"
Expand Down
8 changes: 6 additions & 2 deletions packages/binding-http/src/http-client-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ export default class HttpClient implements ProtocolClient {
return request;
}

private async fetch(request: Request, content?: Content) {
const result = await fetch(request, { body: content?.body });
private async fetch(request: Request) {
// TODO: need investigation. Even if the request has already a body
// if we don't pass it again to the fetch as request init the stream is
// not correctly consumed
// see https://github.com/eclipse-thingweb/node-wot/issues/1366.
const result = await fetch(request, { body: request.body });

if (HttpClient.isOAuthTokenExpired(result, this.credential)) {
this.credential = await (this.credential as OAuthCredential).refreshToken();
Expand Down
Loading