Add User-Agent to image request to prevent 403 response status

This commit is contained in:
rl-king
2020-04-18 13:29:07 +02:00
parent 4bff3c785c
commit 239b2e1cf8
+4 -1
View File
@@ -97,7 +97,10 @@ async function loadImageFilePromise(imageUrl) {
try {
buffer = await requestPromiseNative.get({
url: imageUrl,
encoding: null // preserves binary encoding
encoding: null, // preserves binary encoding
headers: {
'User-Agent' : 'wordpress-export-to-markdown'
}
});
} catch (ex) {
if (ex.name === 'StatusCodeError') {