mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added consistency in oembed request timeouts and user-agent
no issue - we were using the `Ghost` user agent when making the initial page request but not when making a subsequent rel="alternate" oembed request - added a 2sec timeout to the rel="alternate" oembed request to match the initial page request
This commit is contained in:
parent
6ddce262be
commit
98e8097340
2 changed files with 10 additions and 2 deletions
|
@ -117,7 +117,11 @@ function fetchOembedData(_url) {
|
|||
// fetch oembed response from embedded rel="alternate" url
|
||||
return request(oembedUrl, {
|
||||
method: 'GET',
|
||||
json: true
|
||||
json: true,
|
||||
timeout: 2 * 1000,
|
||||
headers: {
|
||||
'user-agent': 'Ghost(https://github.com/TryGhost/Ghost)'
|
||||
}
|
||||
}).then((response) => {
|
||||
// validate the fetched json against the oembed spec to avoid
|
||||
// leaking non-oembed responses
|
||||
|
|
|
@ -112,7 +112,11 @@ function fetchOembedData(_url) {
|
|||
// fetch oembed response from embedded rel="alternate" url
|
||||
return request(oembedUrl, {
|
||||
method: 'GET',
|
||||
json: true
|
||||
json: true,
|
||||
timeout: 2 * 1000,
|
||||
headers: {
|
||||
'user-agent': 'Ghost(https://github.com/TryGhost/Ghost)'
|
||||
}
|
||||
}).then((response) => {
|
||||
// validate the fetched json against the oembed spec to avoid
|
||||
// leaking non-oembed responses
|
||||
|
|
Loading…
Add table
Reference in a new issue