handle missing user agent case
This commit is contained in:
parent
8211e67ed7
commit
ab9594fe62
|
@ -468,7 +468,7 @@ app.get("/notes/*", function (request, response) {
|
||||||
app.get('/deviceinfo', function (request, response) {
|
app.get('/deviceinfo', function (request, response) {
|
||||||
const userAgent = request.header('user-agent');
|
const userAgent = request.header('user-agent');
|
||||||
const deviceDetector = new DeviceDetector();
|
const deviceDetector = new DeviceDetector();
|
||||||
const deviceInfo = deviceDetector.parse(userAgent);
|
const deviceInfo = deviceDetector.parse(userAgent || "");
|
||||||
return response.send(deviceInfo);
|
return response.send(deviceInfo);
|
||||||
});
|
});
|
||||||
app.get('/version', function (_, response) {
|
app.get('/version', function (_, response) {
|
||||||
|
|
Loading…
Reference in New Issue