summaryrefslogtreecommitdiff
path: root/node_modules/uri-js/dist/esnext/schemes/http.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-11-05 17:16:09 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-11-05 17:16:09 +0800
commitd1d9f00b1bd660842addf5e6b1d1b64c852a9eea (patch)
tree60fb37ae73a1109d95301de5ec9b61b5726a4b61 /node_modules/uri-js/dist/esnext/schemes/http.js
parent7c85166c4cbdd862fc4252007d2df5befcbc2a58 (diff)
added hover prefixer
Diffstat (limited to 'node_modules/uri-js/dist/esnext/schemes/http.js')
-rwxr-xr-xnode_modules/uri-js/dist/esnext/schemes/http.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js
new file mode 100755
index 00000000..6abf0fe6
--- /dev/null
+++ b/node_modules/uri-js/dist/esnext/schemes/http.js
@@ -0,0 +1,28 @@
+const handler = {
+ scheme: "http",
+ domainHost: true,
+ parse: function (components, options) {
+ //report missing host
+ if (!components.host) {
+ components.error = components.error || "HTTP URIs must have a host.";
+ }
+ return components;
+ },
+ serialize: function (components, options) {
+ const secure = String(components.scheme).toLowerCase() === "https";
+ //normalize the default port
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
+ components.port = undefined;
+ }
+ //normalize the empty path
+ if (!components.path) {
+ components.path = "/";
+ }
+ //NOTE: We do not parse query strings for HTTP URIs
+ //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
+ //and not the HTTP spec.
+ return components;
+ }
+};
+export default handler;
+//# sourceMappingURL=http.js.map \ No newline at end of file