Skip to content

Conversation

@AC17dollars
Copy link
Member

Potential fix for https://github.com/ecastthapathali/ecastthapathali.github.io/security/code-scanning/2

To properly check if the current site is a GitHub Pages domain, we need to ensure that the window.location.hostname has a value that ends with .github.io, and that it matches the expected domain format. This can be done by:

  • Replacing .includes("github.io") with .endsWith(".github.io").
  • Optionally, you could also check that the host consists of a non-empty subdomain before .github.io (not required by the original code, but implies a single-level subdomain as used by GitHub Pages with user and organization pages).

The change is limited to a single line in the redirectToHome function, replacing line 58.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

… sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@AC17dollars AC17dollars marked this pull request as ready for review December 14, 2025 14:17
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