Skip to content

Commit

Permalink
fix: handle stricter typing in updated axios
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Feb 10, 2023
1 parent d53b0a6 commit cfd42e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rest/AxiosHTTP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AxiosHTTP extends AbstractHTTP {
return this.getImpl(options).request(opts).then((response) => {
let type;
if (response.headers && response.headers['Content-Type']) {
type = response.headers['Content-Type'];
type = response.headers['Content-Type'] as string;
}
return OnmsResult.ok(this.getData(response), undefined, response.status, type);
}).catch((err) => {
Expand All @@ -87,7 +87,7 @@ export class AxiosHTTP extends AbstractHTTP {
return this.getImpl(options).request(opts).then((response) => {
let type;
if (response.headers && response.headers['Content-Type']) {
type = response.headers['Content-Type'];
type = response.headers['Content-Type'] as string;
}
return OnmsResult.ok(this.getData(response), undefined, response.status, type);
}).catch((err) => {
Expand All @@ -113,7 +113,7 @@ export class AxiosHTTP extends AbstractHTTP {
return this.getImpl(options).request(opts).then((response) => {
let type;
if (response.headers && response.headers['Content-Type']) {
type = response.headers['Content-Type'];
type = response.headers['Content-Type'] as string;
}
return OnmsResult.ok(this.getData(response), undefined, response.status, type);
}).catch((err) => {
Expand All @@ -138,7 +138,7 @@ export class AxiosHTTP extends AbstractHTTP {
return this.getImpl(options).request(opts).then((response) => {
let type;
if (response.headers && response.headers['Content-Type']) {
type = response.headers['Content-Type'];
type = response.headers['Content-Type'] as string;
}
return OnmsResult.ok(this.getData(response), undefined, response.status, type);
}).catch((err) => {
Expand All @@ -163,7 +163,7 @@ export class AxiosHTTP extends AbstractHTTP {
return this.getImpl(options).request(opts).then((response) => {
let type;
if (response.headers && response.headers['Content-Type']) {
type = response.headers['Content-Type'];
type = response.headers['Content-Type'] as string;
}
return OnmsResult.ok(this.getData(response), undefined, response.status, type);
}).catch((err) => {
Expand Down

0 comments on commit cfd42e3

Please sign in to comment.