a280369881c13069354326abc0a404605a444abd
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / uri-js / dist / esnext / schemes / http.js
1 const handler = {\r
2     scheme: "http",\r
3     domainHost: true,\r
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
8         }\r
9         return components;\r
10     },\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
15         }\r
16         //normalize the empty path\r
17         if (!components.path) {\r
18             components.path = "/";\r
19         }\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
23         return components;\r
24     }\r
25 };\r
26 export default handler;\r
27 //# sourceMappingURL=http.js.map