Added COUNTRY_IP_HEADER environment variable. Closes #814.
This commit is contained in:
@@ -52,6 +52,11 @@ export function getDevice(screen, browser, os) {
|
||||
}
|
||||
|
||||
export async function getCountry(req, ip) {
|
||||
// Custom header
|
||||
if (req.headers[process.env.COUNTRY_IP_HEADER]) {
|
||||
return req.headers[process.env.COUNTRY_IP_HEADER];
|
||||
}
|
||||
|
||||
// Cloudflare
|
||||
if (req.headers['cf-ipcountry']) {
|
||||
return req.headers['cf-ipcountry'];
|
||||
|
||||
Reference in New Issue
Block a user