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.8 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.7 node_modules/uri-js/dist/esnext/schemes/http.js
immosquare-cleaner-0.1.6 node_modules/uri-js/dist/esnext/schemes/http.js
decidim-0.26.8 packages/eslint-config/node_modules/uri-js/dist/esnext/schemes/http.js
trusty-cms-5.0.7 node_modules/uri-js/dist/esnext/schemes/http.js
tang-0.2.1 spec/tang_app/node_modules/uri-js/dist/esnext/schemes/http.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/uri-js/dist/esnext/schemes/http.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/uri-js/dist/esnext/schemes/http.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/uri-js/dist/esnext/schemes/http.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/uri-js/dist/esnext/schemes/http.js
tang-0.2.0 spec/tang_app/node_modules/uri-js/dist/esnext/schemes/http.js
tang-0.1.0 spec/tang_app/node_modules/uri-js/dist/esnext/schemes/http.js
tang-0.0.9 spec/tang_app/node_modules/uri-js/dist/esnext/schemes/http.js