mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 11:05:36 +01:00
Fix multiple issues: tracker multiple execution, credentials configurable, exclude-hash, and other fixes
This commit is contained in:
parent
d590c6b078
commit
46532f0778
23 changed files with 553 additions and 30 deletions
38
contributions/ipv6-location-fix.js
Normal file
38
contributions/ipv6-location-fix.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Fix for issue #3624: Location statistics broken when tracking IPv6 clients
|
||||
// File: src/lib/__tests__/detect.test.ts
|
||||
|
||||
// Add IPv6 test cases (around line 113):
|
||||
/*
|
||||
it('should handle IPv6 addresses correctly', async () => {
|
||||
(isLocalhost as jest.Mock).mockResolvedValue(false);
|
||||
|
||||
const mockMaxmindDb = {
|
||||
get: jest.fn().mockReturnValue({
|
||||
country: { iso_code: 'US' },
|
||||
subdivisions: [{ iso_code: 'CA' }],
|
||||
city: { names: { en: 'Los Angeles' } },
|
||||
}),
|
||||
};
|
||||
|
||||
(maxmind.open as jest.Mock).mockResolvedValue(mockMaxmindDb);
|
||||
|
||||
// Test IPv6 with port
|
||||
const result1 = await getLocation('[2001:db8::1]:8080', new Headers(), false);
|
||||
expect(result1).toEqual({
|
||||
country: 'US',
|
||||
region: 'US-CA',
|
||||
city: 'Los Angeles',
|
||||
});
|
||||
|
||||
// Test IPv6 without port
|
||||
const result2 = await getLocation('2001:db8::1', new Headers(), false);
|
||||
expect(result2).toEqual({
|
||||
country: 'US',
|
||||
region: 'US-CA',
|
||||
city: 'Los Angeles',
|
||||
});
|
||||
|
||||
// Verify that the MaxMind database is called with the cleaned IP
|
||||
expect(mockMaxmindDb.get).toHaveBeenCalledWith('2001:db8::1');
|
||||
});
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue