Permalink
Browse files

[fix] Encoding data

  • Loading branch information...
1 parent d48b712 commit e662bc8f6ff06aa93a33ca1656162f914d9bdacf @alejandro alejandro committed Sep 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 proxy/proxy.js
View
@@ -58,12 +58,12 @@ fs.watchFile(config.opt.proxy_table_file, function (oldts, newts) {
});
function readIP (){
- return fs.readFile(__dirname + '/ips.json', function(err, data){
+ return fs.readFile(__dirname + '/ips.json','utf8', function(err, data){
if (err) {
log.info('Can\'t load the ips (read)');
} else {
try {
- bannedIPs = data;
+ bannedIPs = JSON.parse(data);
log.info('ips updated');
} catch (exc) {
log.warn(exc);

0 comments on commit e662bc8

Please sign in to comment.