mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-17 21:53:49 +09:00
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:
+4
-1
@@ -97,7 +97,10 @@ async function loadImageFilePromise(imageUrl) {
|
|||||||
try {
|
try {
|
||||||
buffer = await requestPromiseNative.get({
|
buffer = await requestPromiseNative.get({
|
||||||
url: imageUrl,
|
url: imageUrl,
|
||||||
encoding: null // preserves binary encoding
|
encoding: null, // preserves binary encoding
|
||||||
|
headers: {
|
||||||
|
'User-Agent' : 'wordpress-export-to-markdown'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
if (ex.name === 'StatusCodeError') {
|
if (ex.name === 'StatusCodeError') {
|
||||||
|
|||||||
Reference in New Issue
Block a user