aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/mattermost/index.js
blob: 8ae5c17a60a1ee4c15ccdf1ca853148bc4d7c1d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module.exports = Franz => class Mattermost extends Franz {
  async validateUrl(url) {
    try {
      const resp = await window.fetch(url, {
        method: 'GET',
        headers: {
          'Content-Type': 'application/json',
        },
      });
      return resp.status.toString().startsWith('2');
    } catch (err) {
      console.error(err);
    }

    return false;
  }
};