Skip to content

Fix protocol handling bug in ContentFetcher #91

Closed

Description

@httpdss

Summary
The githubhttps:// protocol is mishandled in ContentFetcher.fetch_content, causing the unstripped full URL to be passed to _fetch_github_https_file which expects owner/repo/branch/path.

Details

  • File: struct_module/content_fetcher.py
  • Current logic special-cases content_location.startswith("http") and bypasses prefix stripping, so "githubhttps://..." is forwarded incorrectly.

Proposed fix

  • Match and handle explicit prefixes in deterministic order before any generic http/https branch.
  • Only treat raw "https://" as an HTTP URL; for "githubhttps://", strip the prefix and route to _fetch_github_https_file with owner/repo/branch/path.
  • Add unit tests covering github://, githubhttps://, githubssh://, and https:// to avoid regressions.

Acceptance criteria

  • githubhttps://owner/repo/branch/path fetches the expected content without errors.
  • Existing protocols (file://, github://, githubssh://, https://) continue to work.
  • Tests added passing in CI.

Activity

  1. added a commit that references this issue on Aug 11, 2025
    3049c26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions