Move list of valid origin prefixes for incoming WebSocket requests to a constant

Summary: Create a constant to hold all valid origin prefixes, for incoming WebSocket requests. This is to make it easier to add additional origins.

Reviewed By: mweststrate

Differential Revision: D26778708

fbshipit-source-id: b89bd8c8d8925b2863f12c319c6ecbeeb265fc42
This commit is contained in:
Pola Abram
2021-03-03 07:52:58 -08:00
committed by Facebook GitHub Bot
parent 4799ea4f09
commit d7fc17c12e
2 changed files with 11 additions and 5 deletions

View File

@@ -42,4 +42,12 @@ export default Object.freeze({
},
SUPPORT_GROUPS: [],
// Only WebSocket requests from the following origin prefixes will be accepted
VALID_WEB_SOCKET_REQUEST_ORIGIN_PREFIXES: [
'chrome-extension://',
'localhost:',
'http://localhost:',
'app://',
],
});