Skip to content

Commit 0a07912

Browse files
authored
Merge pull request #71 from common-workflow-language/single-file-override
Allow URLs to particular files in a Github directory
2 parents ecc68d2 + 989234f commit 0a07912

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/commonwl/viewer/services/GitHubService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class GitHubService {
5656
private final RepositoryService repoService;
5757

5858
// URL validation for directory links
59-
private final String GITHUB_DIR_REGEX = "^https:\\/\\/github\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:tree\\/([^/]+)\\/(.*))?$";
59+
private final String GITHUB_DIR_REGEX = "^https?:\\/\\/github\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:(?:tree|blob)\\/([^/]+)\\/(.*))?$";
6060
private final Pattern githubDirPattern = Pattern.compile(GITHUB_DIR_REGEX);
6161

6262
@Autowired

0 commit comments

Comments
 (0)