Sha256: 27e8e9bb4fcdb262ee6e6f5305051d6dd6b9d305caf2a98f9bb4bee14f702561

Contents?: true

Size: 959 Bytes

Versions: 53

Compression:

Stored size: 959 Bytes

Contents

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

Version data entries

53 entries across 52 versions & 7 rubygems

Version Path
immosquare-cleaner-0.1.29 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.28 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.27 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.26 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.25 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.24 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.23 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.22 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.21 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.20 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.19 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.18 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.17 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.16 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.14 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.13 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.12 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.11 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.10 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.9 node_modules/uri-js/dist/esnext/schemes/http.js