MCPcopy Create free account
hub / github.com/Effect-TS/effect / isValidHost

Function isValidHost

packages/effect/src/http/HttpMiddleware.ts:561–561  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

559// The shape check rules out paths, userinfo and lists; the URL parser rejects
560// invalid IP literals and out-of-range ports, matching what `toURL` accepts.
561const isValidHost = (host: string): boolean => hostShape.test(host) && URL.canParse(`http://${host}`)
562
563/**
564 * Middleware that parses the current request URL's search parameters and provides them as `ParsedSearchParams`.

Callers 1

applyXForwardedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected