MCPcopy Create free account
hub / github.com/CommE2E/comm / getAppURLFactsFromRequestURL

Function getAppURLFactsFromRequestURL

keyserver/src/utils/urls.js:65–75  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

63// ESLint doesn't recognize that invariant always throws
64// eslint-disable-next-line consistent-return
65function getAppURLFactsFromRequestURL(url: string): AppURLFacts {
66 const webAppURLFacts = getWebAppURLFacts();
67 if (webAppURLFacts && url.startsWith(webAppURLFacts.baseRoutePath)) {
68 return webAppURLFacts;
69 }
70 const keyserverURLFacts = getKeyserverURLFacts();
71 if (keyserverURLFacts && url.startsWith(keyserverURLFacts.baseRoutePath)) {
72 return keyserverURLFacts;
73 }
74 invariant(false, 'request received but no URL facts are present');
75}
76
77function getLandingURLFacts(): ?AppURLFacts {
78 return cachedURLFacts.get('landing');

Callers 4

assertSecureRequestFunction · 0.90
htmlHandlerFunction · 0.90
websiteResponderFunction · 0.90
getRequestIPAddressFunction · 0.90

Calls 2

getWebAppURLFactsFunction · 0.85
getKeyserverURLFactsFunction · 0.85

Tested by

no test coverage detected