Skip to content

parseHttp1RequestTarget

parseHttp1RequestTarget(method, target): Http1RequestTarget | null

Defined in: packages/format-http/src/h1/http1-request-target.ts:36

Classifies a request-target and splits an absolute one into its parts.

Only the shape is checked: the path is neither decoded nor normalised, so .. segments and percent-encodings reach the caller as sent. Resolving a path against a file system is where traversal has to be stopped.

string

The request method, which decides whether the authority and asterisk forms are allowed.

string

The request-target as decoded.

Http1RequestTarget | null

The target, or null when it fits no form allowed for method.