Skip to content

Fix giscus origin validation in giscus.json#174

Merged
alamb merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-giscus-origins
May 10, 2026
Merged

Fix giscus origin validation in giscus.json#174
alamb merged 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-giscus-origins

Conversation

@kevinjqliu
Copy link
Copy Markdown
Contributor

Fixes #173 (comment)
Followup to #172

What

Change giscus.json origins from https://datafusion.apache.org/blog to https://datafusion.apache.org.

Why

Giscus checks the embedding page's window.origin against the origins list using strict equality:

string === window.origin

window.origin is always protocol + host + port with no path. So window.origin on any page under datafusion.apache.org is https://datafusion.apache.org, which never matched https://datafusion.apache.org/blog.

When the origin check fails, giscus redirects its iframe to https://github.com/orgs/giscus/discussions/1298, which is then blocked by the site's CSP frame-src directive (since github.com isn't allowed), producing:

Framing 'https://github.com/' violates the following Content Security Policy directive: "frame-src ..."

References

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/fix-giscus-origins branch from 286ad13 to f3ea4cc Compare May 10, 2026 16:10
@alamb alamb merged commit dac0ac8 into apache:main May 10, 2026
4 checks passed
@alamb
Copy link
Copy Markdown
Contributor

alamb commented May 10, 2026

Thanks @kevinjqliu

@kevinjqliu kevinjqliu deleted the kevinjqliu/fix-giscus-origins branch May 10, 2026 21:29
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