Page MenuHomePhorge

D15070.1765047715.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D15070.1765047715.diff

diff --git a/keyserver/src/socket/socket.js b/keyserver/src/socket/socket.js
--- a/keyserver/src/socket/socket.js
+++ b/keyserver/src/socket/socket.js
@@ -15,7 +15,7 @@
} from 'lib/shared/timeouts.js';
import { mostRecentUpdateTimestamp } from 'lib/shared/update-utils.js';
import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
-import { endpointIsSocketSafe } from 'lib/types/endpoints.js';
+import { endpointIsSocketSafe, endpoints } from 'lib/types/endpoints.js';
import { redisMessageTypes, type RedisMessage } from 'lib/types/redis-types.js';
import {
serverRequestTypes,
@@ -126,7 +126,7 @@
),
id: t.Number,
payload: tShape({
- endpoint: t.String,
+ endpoint: t.enums.of(endpoints),
input: t.maybe(t.Object),
}),
}),
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -1,5 +1,7 @@
// @flow
+import { values } from '../utils/objects.js';
+
export type APIRequest = {
endpoint: Endpoint,
input?: Object,
@@ -144,3 +146,16 @@
export function endpointIsSocketOnly(endpoint: Endpoint): boolean {
return socketOnlyEndpointSet.has(endpoint);
}
+
+const httpOnlyEndpoints = Object.freeze({
+ ...sessionChangingEndpoints,
+ ...uploadEndpoints,
+ ...largeDataFetchEndpoints,
+});
+
+export const endpoints: $ReadOnlyArray<Endpoint> = [
+ ...values(httpOnlyEndpoints),
+ ...values(socketOnlyEndpoints),
+ ...values(httpPreferredEndpoints),
+ ...values<string, Endpoint>(socketPreferredEndpoints),
+];

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 6, 7:01 PM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840286
Default Alt Text
D15070.1765047715.diff (1 KB)

Event Timeline