We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00f6809 commit d27047cCopy full SHA for d27047c
src/utils/index.js
@@ -34,7 +34,18 @@ const logger = pinoInit({
34
level: process.env.NODE_ENV === 'test' ? 'silent' : 'info'
35
})
36
37
-const validateGithubUrl = (url) => isURL(url, { protocols: ['https'], require_protocol: true }) && url.includes('github.com')
+const validateGithubUrl = (url) => {
38
+ if (!isURL(url, { protocols: ['https'], require_protocol: true })) {
39
+ return false
40
+ }
41
+ try {
42
+ const parsedUrl = new URL(url)
43
+ const allowedHosts = ['github.com', 'www.github.com']
44
+ return allowedHosts.includes(parsedUrl.host)
45
+ } catch (error) {
46
47
48
+}
49
50
const ensureGithubToken = () => {
51
if (!process.env.GITHUB_TOKEN) {
0 commit comments