Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / uri-js / dist / esnext / schemes / http.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/uri-js/dist/esnext/schemes/http.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/uri-js/dist/esnext/schemes/http.js
new file mode 100644 (file)
index 0000000..a280369
--- /dev/null
@@ -0,0 +1,27 @@
+const handler = {\r
+    scheme: "http",\r
+    domainHost: true,\r
+    parse: function (components, options) {\r
+        //report missing host\r
+        if (!components.host) {\r
+            components.error = components.error || "HTTP URIs must have a host.";\r
+        }\r
+        return components;\r
+    },\r
+    serialize: function (components, options) {\r
+        //normalize the default port\r
+        if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") {\r
+            components.port = undefined;\r
+        }\r
+        //normalize the empty path\r
+        if (!components.path) {\r
+            components.path = "/";\r
+        }\r
+        //NOTE: We do not parse query strings for HTTP URIs\r
+        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,\r
+        //and not the HTTP spec.\r
+        return components;\r
+    }\r
+};\r
+export default handler;\r
+//# sourceMappingURL=http.js.map
\ No newline at end of file