Skip to content

Commit

Permalink
fix: Clear timeout regardless response status
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Jan 9, 2023
1 parent 2852ec6 commit 7b4e170
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http/http-native-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ export class HttpNativeImpl extends BaseHttp implements Http {
try {
this.logger?.debug(`↑ ${request.method} ${request.url}`, request.body);
const response = await fetch(request);
timeout.clear();

if (!response.ok) {
throw response;
}

timeout.clear();
const text = await response.text();
const contentType = getContentType(response.headers);
if (contentType == undefined) {
Expand Down

0 comments on commit 7b4e170

Please sign in to comment.