sepandhaghighi / sepandhaghighi/githubp

[Bug]: Reject non-GitHub URLs in `parseGithubPath()`

Open
#48 0 comments 0 reactions 1 assignee View on GitHub

@sepandhaghighi is already working on this.

Since Sep 1, 2026.

bug
Dominant language
JavaScript
Stars
15
Forks
0
Avg merge
1d 18h
Merged PRs (30d)
2

Description

Contact details

me@sepand.tech

What happened?

parseGithubPath() accepts any URL that starts with http and extracts its first two path segments as a GitHub username and repository name. As a result, URLs from unrelated domains can be incorrectly converted into GitHub Pages URLs.

For example:

https://example.com/alice/project

can be interpreted as:

https://alice.github.io/project

Steps to reproduce
  1. Open GitHubP.

  2. Enter: https://example.com/alice/project

  3. Click Go.

Expected behavior

Only URLs belonging to github.com should be accepted when a full URL is provided.

For example:

https://github.com/alice/project
https://www.github.com/alice/project

should be accepted, while:

https://example.com/alice/project

should be rejected with the existing Invalid GitHub path error.

Actual behavior

A URL from an unrelated domain can be parsed as a valid GitHub path and redirected to the corresponding GitHub Pages URL.

Device type

Desktop

Browser

Chrome

GitHubP version

GitHubP 0.6

Relevant log output

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.