This commit is contained in:
eric sciple 2020-01-24 12:20:47 -05:00
parent a004f0ae58
commit fc725ba36b
7280 changed files with 19 additions and 1796407 deletions

View file

@ -1,36 +0,0 @@
import { URISchemeHandler, URIComponents, URIOptions } from "../uri";
const handler:URISchemeHandler = {
scheme : "http",
domainHost : true,
parse : function (components:URIComponents, options:URIOptions):URIComponents {
//report missing host
if (!components.host) {
components.error = components.error || "HTTP URIs must have a host.";
}
return components;
},
serialize : function (components:URIComponents, options:URIOptions):URIComponents {
//normalize the default port
if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || 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;