Merge pull request #14886 from gustavotrott/remove-html5-useragent

refactor: Remove the endpoint html5/useragent
This commit is contained in:
Anton Georgiev 2022-04-26 12:34:07 -04:00 committed by GitHub
commit f7b9b189c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 64 deletions

View File

@ -4,7 +4,6 @@ import Langmap from 'langmap';
import fs from 'fs'; import fs from 'fs';
import Users from '/imports/api/users'; import Users from '/imports/api/users';
import './settings'; import './settings';
import { lookup as lookupUserAgent } from 'useragent';
import { check } from 'meteor/check'; import { check } from 'meteor/check';
import Logger from './logger'; import Logger from './logger';
import Redis from './redis'; import Redis from './redis';
@ -303,20 +302,6 @@ WebApp.connectHandlers.use('/feedback', (req, res) => {
})); }));
}); });
WebApp.connectHandlers.use('/useragent', (req, res) => {
const userAgent = req.headers['user-agent'];
let response = 'No user agent found in header';
if (userAgent) {
response = lookupUserAgent(userAgent).toString();
}
Logger.info(`The requesting user agent is ${response}`);
// res.setHeader('Content-Type', 'application/json');
res.writeHead(200);
res.end(response);
});
WebApp.connectHandlers.use('/guestWait', (req, res) => { WebApp.connectHandlers.use('/guestWait', (req, res) => {
if (!guestWaitHtml) { if (!guestWaitHtml) {
try { try {

View File

@ -3814,6 +3814,11 @@
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
} }
}, },
"trim-newlines": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz",
"integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew=="
},
"type-fest": { "type-fest": {
"version": "0.18.1", "version": "0.18.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
@ -5240,11 +5245,6 @@
"word-wrap": "^1.2.3" "word-wrap": "^1.2.3"
} }
}, },
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"p-finally": { "p-finally": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
@ -5498,11 +5498,6 @@
"react-is": "^16.13.1" "react-is": "^16.13.1"
} }
}, },
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"psl": { "psl": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
@ -6591,14 +6586,6 @@
"popper.js": "^1.16.0" "popper.js": "^1.16.0"
} }
}, },
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
"requires": {
"os-tmpdir": "~1.0.2"
}
},
"to-regex-range": { "to-regex-range": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@ -6617,11 +6604,6 @@
"punycode": "^2.1.1" "punycode": "^2.1.1"
} }
}, },
"trim-newlines": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz",
"integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw=="
},
"triple-beam": { "triple-beam": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
@ -6722,31 +6704,6 @@
"punycode": "^2.1.0" "punycode": "^2.1.0"
} }
}, },
"useragent": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz",
"integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==",
"requires": {
"lru-cache": "4.1.x",
"tmp": "0.0.x"
},
"dependencies": {
"lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"requires": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
}
}
},
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",

View File

@ -78,7 +78,6 @@
"sdp-transform": "2.7.0", "sdp-transform": "2.7.0",
"string-hash": "~1.1.3", "string-hash": "~1.1.3",
"tippy.js": "^5.1.3", "tippy.js": "^5.1.3",
"useragent": "^2.3.0",
"wasm-check": "^2.0.3", "wasm-check": "^2.0.3",
"winston": "^3.7.2", "winston": "^3.7.2",
"yaml": "^1.7.2" "yaml": "^1.7.2"