diff --git a/packages/online-editor/src/importFromUrl/ImportableUrlHooks.tsx b/packages/online-editor/src/importFromUrl/ImportableUrlHooks.tsx index 664da3e60d2..a7cb1a9858b 100644 --- a/packages/online-editor/src/importFromUrl/ImportableUrlHooks.tsx +++ b/packages/online-editor/src/importFromUrl/ImportableUrlHooks.tsx @@ -334,7 +334,7 @@ export function useImportableUrl(urlString?: string, allowedUrlTypes?: UrlType[] if (url.host === "raw.githubusercontent.com") { const gitHubRawFileMatch = matchPath<{ org: string; repo: string; tree: string; path: string }>(url.pathname, { - path: "/:org/:repo/:tree/:path*", + path: "/:org/:repo/refs/heads/:tree/:path*", exact: true, strict: true, sensitive: false, diff --git a/packages/serverless-logic-web-tools/src/workspace/hooks/ImportableUrlHooks.tsx b/packages/serverless-logic-web-tools/src/workspace/hooks/ImportableUrlHooks.tsx index aa70b60c32f..62e2e60d52e 100644 --- a/packages/serverless-logic-web-tools/src/workspace/hooks/ImportableUrlHooks.tsx +++ b/packages/serverless-logic-web-tools/src/workspace/hooks/ImportableUrlHooks.tsx @@ -152,7 +152,7 @@ export function useImportableUrl(args: { } const gitHubRawFileMatch = matchPath<{ org: string; repo: string; tree: string; path: string }>(url.pathname, { - path: "/:org/:repo/:tree/:path*", + path: "/:org/:repo/refs/heads/:tree/:path*", exact: true, strict: true, sensitive: false,