heyxyz / hey

Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿
https://hey.xyz
GNU Affero General Public License v3.0
23.19k stars 1.53k forks source link

feat: support frame post_redirect spec #5208

Closed defispartan closed 4 weeks ago

defispartan commented 1 month ago

What does this PR do?

Add support for frames post_redirect action.

If frame button action is post_redirect -> make POST request to frame URL -> if frame correctly returns 302 status and url in location header then prompt user to redirect to url.

Replaces axios.post with default fetch for Frame requests. After doing extensive research, axios.post does not have an equivalent of redirect: "manual" which is required to support post_redirect otehrwise axios always the HTML of the redirected site which is not the intended response.

Created demo post_redirect frame for testing that is working correctly on this branch, and checked that this changed does not break existing Frames as well (https://hey,xyz/u/nftminterr contains several posts to test with).

Related issues

Type of change

Explanation of the changes

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web ✅ Ready (Inspect) Visit Preview Aug 15, 2024 3:59am
bigint commented 1 month ago

@defispartan is it good to go?

defispartan commented 1 month ago

@bigint I'm still getting an error when I test the demo Frame that I was sent (https://web-dkap8t730-heyxyz.vercel.app/posts/0x020e3d-0x45-DA-46888385).

I'll check tomorrow to see if this an issue with the Frame or on the Hey side