123456789101112131415161718192021222324252627 |
- const handler = {
- scheme: "http",
- domainHost: true,
- parse: function (components, options) {
-
- if (!components.host) {
- components.error = components.error || "HTTP URIs must have a host.";
- }
- return components;
- },
- serialize: function (components, options) {
-
- if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") {
- components.port = undefined;
- }
-
- if (!components.path) {
- components.path = "/";
- }
-
-
-
- return components;
- }
- };
- export default handler;
|