Skip to content

Conversation

lozeone
Copy link

@lozeone lozeone commented Dec 11, 2020

When attempting to process Instagram posts in Embed::process(), $response = $dispatcher->dispatch($url); returns an error code (429) because the URL does not use the IG endpoint with the access token. (On localhost environments it returns 200, but not when it's on a production server).

Since the response has an error code, The default Webpage adapter it uses fails on $adapter::check($response) and it never gets a chance to check the url with the correct endpoint and token.

Here I added an adapter file for Instagram that passes for 200 or 429 codes

I'm not sure if Facebook posts need to do this as well, since they both require the same token.

see my initial comment here: #411 (comment)

@lozeone
Copy link
Author

lozeone commented Dec 11, 2020

Also, I'm not sure if this needs to be fixed in v4.x, I'm using v3.4 because I'm limited to PHP 7.2 for this project.

@oscarotero oscarotero merged commit 01c284d into php-embed:v3.x Dec 13, 2020
@oscarotero
Copy link
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants