Repository navigation
Description
Summary
Importing a DSL / app from a GitHub file link does not work when the URL host contains uppercase letters. Dify resolves GitHub blob links to raw.githubusercontent.com links with libs.url_utils.github_blob_to_raw_url before downloading an import source. That helper only accepts the exact lowercase host github.com, so a link such as https://GitHub.com/... is returned unchanged instead of being pointed at the raw file.
Affected code path
github_blob_to_raw_url is called by the DSL/app import paths:
api/services/app_dsl_service.py—yaml_url = github_blob_to_raw_url(yaml_url)api/services/app_import_source.py—url = github_blob_to_raw_url(url)api/services/rag_pipeline/rag_pipeline_dsl_service.py—yaml_url = github_blob_to_raw_url(yaml_url)api/services/workflow/dsl_import.py—fetch_yaml_urlcalls it for URLs whose path ends with.yml/.yaml, beforeraise_for_status()and decoding the response as UTF-8 YAML
In api/libs/url_utils.py the guard includes parsed.netloc != "github.com", and the function rewrites the netloc to raw.githubusercontent.com only when that guard passes.
Reproduction
The helper is a pure function, so the mismatch reproduces directly:
from libs.url_utils import github_blob_to_raw_url
lower = "https://github.com/acme/app/blob/main/dsl.yml"
upper = "https://GitHub.com/acme/app/blob/main/dsl.yml"
github_blob_to_raw_url(lower)
# 'https://raw.githubusercontent.com/acme/app/main/dsl.yml'
github_blob_to_raw_url(upper)
# 'https://GitHub.com/acme/app/blob/main/dsl.yml' (unchanged)End to end: store a valid DSL YAML file at https://github.com/<owner>/<repo>/blob/main/app.yml and import it in Dify. With the lowercase host the link is converted to the raw file URL (the result above). With the same link spelled https://GitHub.com/<owner>/<repo>/blob/main/app.yml, the link is not converted, so the import request keeps the blob page URL rather than the raw file URL.
Expected behavior
URL host names are case-insensitive (RFC 3986 section 3.2.2). github_blob_to_raw_url should treat github.com, GitHub.com, and GITHUB.COM identically and return the same https://raw.githubusercontent.com/<owner>/<repo>/<ref>/<file> URL for each. Links that are not GitHub blob file URLs — other hosts, GitHub subdomains, tree paths, non-HTTPS schemes — should keep being returned unchanged.
Activity
dosubot commentedon Nov 20, 2026
This is separate from the path-corruption bug addressed by #44280, merged October 30. That PR centralized the four import paths, but the shared helper still compares
parsed.netlocto the exact string"github.com", leaving mixed-case hosts unchanged. [1]A workaround is to supply the raw URL directly, for example
https://raw.githubusercontent.com/<owner>/<repo>/main/app.yml. The helper leaves that host unchanged, and the YAML importer downloads the resulting URL directly, bypassing the blob-to-raw conversion. [1] [2]To reply, just mention @dosu.
Docs are dead. Just use Dosu.