mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-30 17:27:44 +03:00
Only check for direct properties from the headers object
This commit is contained in:
@@ -389,4 +389,10 @@ describe('Read user-agent data from req.headers', function () {
|
||||
const { browser } = UAParser(hEaDeRs);
|
||||
assert.strictEqual(browser.toString(), "Midori 0.2.2");
|
||||
});
|
||||
|
||||
it('Empty headers should not raise any error', function () {
|
||||
const emptyHeaders = {};
|
||||
const { browser } = UAParser(emptyHeaders);
|
||||
assert.strictEqual(browser.toString(), "undefined");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user