4 parse: function (components, options) {
\r
5 //report missing host
\r
6 if (!components.host) {
\r
7 components.error = components.error || "HTTP URIs must have a host.";
\r
11 serialize: function (components, options) {
\r
12 //normalize the default port
\r
13 if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") {
\r
14 components.port = undefined;
\r
16 //normalize the empty path
\r
17 if (!components.path) {
\r
18 components.path = "/";
\r
20 //NOTE: We do not parse query strings for HTTP URIs
\r
21 //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
\r
22 //and not the HTTP spec.
\r
26 export default handler;
\r
27 //# sourceMappingURL=http.js.map