git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6e9c872
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
node_modules
uri-js
dist
esnext
schemes
http.js
[add] server:lib:node_modules
Christian Fraß
commited
6e9c872
at 2021-03-08 23:52:07
http.js
Blame
History
Raw
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