MCPcopy Create free account
hub / github.com/cameri/nostream / getRelayUrlPathPrefix

Function getRelayUrlPathPrefix

src/utils/http.ts:86–96  ·  view source on GitHub ↗
(relayUrl: string | undefined)

Source from the content-addressed store, hash-verified

84}
85
86const getRelayUrlPathPrefix = (relayUrl: string | undefined): string => {
87 if (typeof relayUrl !== 'string') {
88 return ''
89 }
90
91 try {
92 return normalizePathPrefix(new URL(relayUrl).pathname)
93 } catch {
94 return ''
95 }
96}
97
98const getTrustedForwardedPathPrefix = (request: IncomingMessage, settings: Settings): string => {
99 const socketAddress = request.socket?.remoteAddress

Callers 1

getPublicPathPrefixFunction · 0.85

Calls 1

normalizePathPrefixFunction · 0.85

Tested by

no test coverage detected