fix: checking for html content-type

This commit is contained in:
Karol Sójko 2022-06-28 14:54:38 +02:00
parent bb53e88a4e
commit 4a430b2701
No known key found for this signature in database
GPG key ID: A50543BF560BDEB0

View file

@ -220,7 +220,10 @@ export class HttpService implements HttpServiceInterface {
}
private responseShouldNotBeDecorated(serviceResponse: AxiosResponse): boolean {
return serviceResponse.headers['content-type'].toLowerCase().includes('text/html')
return (
serviceResponse.headers['content-type'] !== undefined &&
serviceResponse.headers['content-type'].toLowerCase().includes('text/html')
)
}
private applyResponseHeaders(serviceResponse: AxiosResponse, response: Response): void {