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