blob: 76901cb2fb3b7683043081f05f8547f366e5a73c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
"use strict";
module.exports = Franz => class GitHubEntreprise extends Franz {
async validateUrl(url) {
try {
const resp = await window.fetch(`${url}/api/v3`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/vnd.github.v3+json'
},
});
//doc: https://developer.github.com/enterprise/2.17/v3/#current-version
return resp.status.toString().startsWith('2');
} catch (err) {
console.error(err);
}
return false;
}
};
|