Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Make apiRoot custom
Browse files Browse the repository at this point in the history
  • Loading branch information
seia-soto committed Feb 17, 2021
1 parent f6c42cc commit dc5702d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/profiles/application/a297.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export default {
apiRoot: 'https://www.clubhouseapi.com/api',
userAgnet: 'clubhouse/297 (iPhone; iOS 14.4; Scale/2.00)',
userAgentStatic: 'Clubhouse/297 CFNetwork/1220.1 Darwin/20.3.0',
appVersion: '0.1.27',
appBuild: '297',
agoraKey: '938de3e8055e42b281bb8c6f69c21f78',
pubnubPubKey: 'pub-c-6878d382-5ae6-4494-9099-f930f938868b',
pubnubSubKey: 'sub-c-a4abea84-9ca3-11ea-8e71-f2b83ac9263d'
pubnubSubKey: 'sub-c-a4abea84-9ca3-11ea-8e71-f2b83ac9263d',
pubnubSDK: 'PubNFub-ObjC-iOS/4.15.11'
}
5 changes: 4 additions & 1 deletion src/profiles/application/a304.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
export default {
apiRoot: 'https://www.clubhouseapi.com/api',
userAgnet: 'clubhouse/304 (iPhone; iOS 14.4; Scale/2.00)',
userAgentStatic: 'Clubhouse/304 CFNetwork/1220.1 Darwin/20.3.0',
appVersion: '0.1.28',
appBuild: '304',
agoraKey: '938de3e8055e42b281bb8c6f69c21f78',
pubnubRoot: 'https://clubhouse.pubnub.com',
pubnubPubKey: 'pub-c-6878d382-5ae6-4494-9099-f930f938868b',
pubnubSubKey: 'sub-c-a4abea84-9ca3-11ea-8e71-f2b83ac9263d'
pubnubSubKey: 'sub-c-a4abea84-9ca3-11ea-8e71-f2b83ac9263d',
pubnubSDK: 'PubNFub-ObjC-iOS/4.15.11'
}
6 changes: 3 additions & 3 deletions src/structures/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid'
const agent = (url, options, customs) => {
'use strict'

url = 'https://www.clubhouseapi.com/api' + (url || '')
url = (customs.apiRoot || 'https://www.clubhouseapi.com/api') + (url || '')

options = options || {}
customs = customs || {}
Expand All @@ -26,13 +26,13 @@ const agent = (url, options, customs) => {
// NOTE: Application;
options.headers.Accept = customs.accept || 'application/json'
options.headers['Accept-Encoding'] = customs.acceptEncodings || 'gzip, deflate, br'
options.headers['Accept-Language'] = customs.acceptLanguages || 'ko-KR;q=1'
options.headers['Accept-Language'] = customs.acceptLanguages || 'en-US;q=1'
// NOTE: Specification;
options.headers.Connection = 'keep-alive'
options.headers.Host = 'www.clubhouseapi.com'

// NOTE: Body;
if (!customs._preventBodySerialization && options.body && typeof options.body === 'object') {
if (!customs._preventBodySerialization && typeof options.body === 'object') {
options.method = 'POST'
options.headers['Content-Type'] = 'application/json; charset=utf-8'
options.body = JSON.stringify(options.body)
Expand Down

0 comments on commit dc5702d

Please sign in to comment.