Home / Docs / Specification / 31. HTTP servers
31.4 The target
Release v0.4.0
- Forms. The target MUST start with
/(origin-form), or be in absolute-form,http://orhttps://in any letter case followed by an authority and an optional path and query. An absolute-form target is accepted only when its scheme is the grant's and its authority equals theHostvalue in ASCII letter case; it is then rewritten to the origin-form of its path and query,/for an empty path, which the program sees astarget. Else it is400. The asterisk-form and the authority-form are400. - Characters. The path holds only
/and the characters of an RFC 3986pchar; the query, after the first?, holds those and?. Each%MUST be followed by two hex digits. Anything else is400: a#, a space,\,|,{,",^, a backquote,<,>,[,], and any byte above 0x7E. RFC 3986 does not allow them unencoded. - Segments. The path after its first
/is split on/, and each segment is percent-decoded alone, so an encoded/never makes a new segment. A segment that decodes to.or.., or that holds/,\, NUL or another control character (below 0x20, or 0x7F), or that is not UTF-8 after decoding, is400./gives[""], and/a//bgives["a", "", "b"]. Forms that other servers read as special, such as..;and the double-encoded%252e%252e, are ordinary segments. - Query. The query is split on
&, and empty parts are skipped. Each part isname=value, split at its first=, ornamewith the value"". A+decodes to a space, then percent-decoding applies. A name or value that is not UTF-8 after decoding is400.