|
@@ -1,5 +1,6 @@
|
|
|
import axios from 'axios';
|
|
|
-import { API_URL } from 'src/constants';
|
|
|
+import { Platform } from 'react-native';
|
|
|
+import { API_URL, APP_VERSION } from 'src/constants';
|
|
|
import { API } from 'src/types';
|
|
|
|
|
|
const SERVER_LIST_URL = API_URL + '/' + API.GET_SERVERS;
|
|
@@ -23,7 +24,12 @@ const testServerSpeed = async (serverUrl: string) => {
|
|
|
|
|
|
export const determineFastestServer = async () => {
|
|
|
try {
|
|
|
- const response = await axios.get(SERVER_LIST_URL);
|
|
|
+ const response = await axios.get(SERVER_LIST_URL, {
|
|
|
+ headers: {
|
|
|
+ 'App-Version': APP_VERSION,
|
|
|
+ 'Platform': Platform.OS
|
|
|
+ }
|
|
|
+ });
|
|
|
const servers = response.data?.maps;
|
|
|
|
|
|
const speedTests = await Promise.allSettled(
|