Skip to content

Commit 72ec67d

Browse files
committed
Possible fix image validation
1 parent 40fb754 commit 72ec67d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mqtt/client.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class MqttClient {
129129
const response = await fetch(thumbnailUrl)
130130
let image = await response.buffer()
131131

132-
const result = validateBufferMIMEType(image, {
132+
const result = await validateBufferMIMEType(image, {
133133
allowMimeTypes: ['image/jpeg', 'image/gif', 'image/png', 'image/svg+xml']
134134
})
135135

@@ -142,11 +142,11 @@ class MqttClient {
142142
const response = await fetch(thumbnailUrl)
143143
image = await response.buffer()
144144

145-
const result = validateBufferMIMEType(image, {
145+
const retryResult = await validateBufferMIMEType(image, {
146146
allowMimeTypes: ['image/jpeg', 'image/gif', 'image/png', 'image/svg+xml']
147147
})
148148

149-
winston.info(`Retry - Image validation result: `, result)
149+
winston.info(`Retry - Image validation result: `, retryResult)
150150
}
151151

152152
const topic = HaDiscovery.baseTopicForCapability(NotificationType.THUMBNAIL, deviceSN)

0 commit comments

Comments
 (0)