Merge pull request #34 from rl-king/user-agent

Add User-Agent to image request to prevent 403 response status
This commit is contained in:
Will Boyd
2020-12-20 14:04:24 -05:00
committed by GitHub
+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') {