consider LOKI x-country-code also anonymizer (still pending code changes to refactor locals.tor into locals.anonymizer)

merge-requests/208/head
Thomas Lynch 4 years ago
parent 4beb89bb22
commit ab1e45114c
  1. 5
      helpers/countries.js
  2. 2
      helpers/geoip.js

@ -2,7 +2,7 @@
const countries = require('i18n-iso-countries')
, countryNamesMap = countries.getNames('en')
, countryCodes = ['EU', 'XX', 'T1', 'TOR']
, countryCodes = ['EU', 'XX', 'T1', 'TOR', 'LOKI']
.concat(Object.keys(countryNamesMap));
//this dumb library conveniently includes 2 names for some countries...
@ -13,7 +13,8 @@ Object.entries(countryNamesMap)
countryNamesMap['EU'] = 'Europe';
countryNamesMap['XX'] = 'Unknown';
countryNamesMap['T1'] = 'Tor Exit Node';
countryNamesMap['TOR'] = 'Tor Onion';
countryNamesMap['TOR'] = 'Tor Hidden Service';
countryNamesMap['LOKI'] = 'Lokinet SNApp';
module.exports = {
countryNamesMap,

@ -5,7 +5,7 @@ const { countryNamesMap } = require(__dirname+'/countries.js')
module.exports = (req, res, next) => {
const code = req.headers[countryCodeHeader] || 'XX';
res.locals.tor = code === 'TOR';
res.locals.tor = code === 'TOR' || code === 'LOKI';
res.locals.country = {
code,
name: countryNamesMap[code],

Loading…
Cancel
Save