Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Article embeds not getting parsed if the pathname matches "/invite/*" #7103

Open
DEVTomatoCake opened this issue Aug 25, 2024 · 0 comments
Open
Labels

Comments

@DEVTomatoCake
Copy link
Contributor

Description

If a website URL matches <base>/invite/<some text>, its embeds aren't parsed by the API.

This is probably related to Discord invites matching https://discord.com/invite/<code>, however, it also breaks the embed of unrelated websites.

Steps to Reproduce

Send the following message on Discord:

https://embedtest.tomatocake.workers.dev/
https://embedtest.tomatocake.workers.dev/test
https://embedtest.tomatocake.workers.dev/invite
https://embedtest.tomatocake.workers.dev/invite/test
https://embedtest.tomatocake.workers.dev/invite/test/test2

The worker running behind it always returns the current pathname as article description:

export default {
    async fetch(request, env, ctx) {
        const parsed = new URL(request.url)
        return new Response("<meta property='og:description' content='" + parsed.pathname + "'>", {
            headers: {
                "Content-Type": "text/html"
            }
        })
    }
}

Expected Behavior

All five links have an embed with their path name.

Current Behavior

The fourth link, https://embedtest.tomatocake.workers.dev/invite/test, doesn't show any embed. It also doesn't have an entry in the embeds array of the message, suggesting an API instead of a client issue.

The embed debugger in the Developer Portal however displays the embed correctly: https://discord.com/developers/embeds?url=https%253A%252F%252Fembedtest.tomatocake.workers.dev%252Finvite%252Ftest

Screenshots/Videos

image

Client and System Information

canary 321657 (4acf674) Host 1.0.435 x64 (51461) Build Override: N/A Windows 11 64-bit (10.0.22631)

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

No branches or pull requests

1 participant