Skip token verification if a special env variable is passed

Summary: Recently , we started verifying a special token for every websocket connection. It made e2e tests fail. We are going to use this bypass flag in jest e2e envs.

Reviewed By: lblasa

Differential Revision: D46025343

fbshipit-source-id: c2e6e0b561286fb8b571565243a45cdfb56a54a9
This commit is contained in:
Andrey Goncharov
2023-05-19 10:19:10 -07:00
committed by Facebook GitHub Bot
parent 4647f52a5b
commit d078a89e83

View File

@@ -254,7 +254,7 @@ function addWebsocket(server: http.Server, config: Config) {
// no origin header? The request is not originating from a browser, so should be OK to pass through
// If origin matches our own address, it means we are serving the page.
return verifyAuthToken(req);
return process.env.SKIP_TOKEN_VERIFICATION ? true : verifyAuthToken(req);
} else {
// for now we don't allow cross origin request, so that an arbitrary website cannot try to
// connect a socket to localhost:serverport, and try to use the all powerful Flipper APIs to read