From b4ff09cc1afa35b70924bd278883ffb2a16ba939 Mon Sep 17 00:00:00 2001 From: lwl2005 <143595741+lwl2005@users.noreply.github.com> Date: Sat, 2 May 2026 11:13:23 +0800 Subject: [PATCH 1/2] Fix regex pattern for GitHub web URLs --- src/domains/services/validation.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domains/services/validation.service.ts b/src/domains/services/validation.service.ts index 11ac45fc4..e2c9f4cb7 100644 --- a/src/domains/services/validation.service.ts +++ b/src/domains/services/validation.service.ts @@ -70,7 +70,7 @@ const convertGitHubWebUrl = (url: string): string => { // Handle GitHub web URLs like: https://github.com/owner/repo/blob/branch/path // eslint-disable-next-line no-useless-escape - const githubWebPattern = /^https:\/\/github\.com\/([^\/]+)\/([^\/]+)\/blob\/([^\/]+)\/(.+)$/; + const githubWebPattern = /^https:\/\/github\.com\/([^\/]+)\/([^\/]+)\/blob\/(.+)\/(.+)$/; const match = urlWithoutFragment.match(githubWebPattern); if (match) { From 100e99c88d18b34cea36835589ddc1c97b09b8ef Mon Sep 17 00:00:00 2001 From: lwl2005 <143595741+lwl2005@users.noreply.github.com> Date: Sat, 2 May 2026 11:16:45 +0800 Subject: [PATCH 2/2] Fix extension extraction to handle missing extensions Handle cases where the file name may not contain an extension. --- src/domains/models/SpecificationFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domains/models/SpecificationFile.ts b/src/domains/models/SpecificationFile.ts index 5370f6e67..c14fb4eed 100644 --- a/src/domains/models/SpecificationFile.ts +++ b/src/domains/models/SpecificationFile.ts @@ -237,7 +237,7 @@ export async function fileExists(name: string): Promise { return true; } - const extension = name.split('.')[1]; + const extension = name.includes('.') ? name.split('.').pop() : ''; const allowedExtenstion = ['yml', 'yaml', 'json'];