diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:09:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-07 16:25:29 +0100 |
commit | 2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f (patch) | |
tree | 998a0af6923475c85eb8e97ca1d30afb42655263 /shared/utils/server/clients.ts | |
parent | 4b49385892b25aea5aa9e605fbcb66074bcb49b0 (diff) | |
parent | 35adc403b7eed6d1309bbce901268a76dd01b6ef (diff) | |
download | PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.gz PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.tar.zst PeerTube-2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f.zip |
Merge branch 'move-utils-to-shared' of https://github.com/buoyantair/PeerTube into buoyantair-move-utils-to-shared
Diffstat (limited to 'shared/utils/server/clients.ts')
-rw-r--r-- | shared/utils/server/clients.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shared/utils/server/clients.ts b/shared/utils/server/clients.ts new file mode 100644 index 000000000..273aac747 --- /dev/null +++ b/shared/utils/server/clients.ts | |||
@@ -0,0 +1,19 @@ | |||
1 | import * as request from 'supertest' | ||
2 | import * as urlUtil from 'url' | ||
3 | |||
4 | function getClient (url: string) { | ||
5 | const path = '/api/v1/oauth-clients/local' | ||
6 | |||
7 | return request(url) | ||
8 | .get(path) | ||
9 | .set('Host', urlUtil.parse(url).host) | ||
10 | .set('Accept', 'application/json') | ||
11 | .expect(200) | ||
12 | .expect('Content-Type', /json/) | ||
13 | } | ||
14 | |||
15 | // --------------------------------------------------------------------------- | ||
16 | |||
17 | export { | ||
18 | getClient | ||
19 | } | ||