mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Add User-Agent to image request to prevent 403 response status
This commit is contained in:
+4
-1
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user