aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-05-06 12:58:50 +0200
committerNoah Loomans <noahloomans@gmail.com>2017-05-06 12:58:50 +0200
commitfd8362125f5bd78c8328afae79549cb2a771f32a (patch)
treee413a472c723752a88c648875e9fc065700a2a00 /routes
parent36ea1abe1f922a4a97c535348c7f1b94fcf6721c (diff)
parent27b4e7b47acbd1fa212db7f11b7b3b310193c009 (diff)
Merge branch 'master' into beta
Diffstat (limited to 'routes')
-rw-r--r--routes/meetingpointProxy.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/routes/meetingpointProxy.js b/routes/meetingpointProxy.js
index b2b51c9..68f3fdf 100644
--- a/routes/meetingpointProxy.js
+++ b/routes/meetingpointProxy.js
@@ -1,16 +1,18 @@
-var express = require('express')
-var router = express.Router()
+const express = require('express')
+const router = express.Router()
const request = require('request')
+const iconv = require('iconv-lite')
-/* GET home page. */
router.get('/:url', function (req, res, next) {
const url = `http://www.meetingpointmco.nl/${req.params.url}`
- request(url, function (err, data) {
+ request(url, { encoding: null }, function (err, data) {
if (err) {
next(err)
return
}
- res.status(data.statusCode).end(data.body)
+
+ const utf8Body = iconv.decode(data.body, 'ISO-8859-1')
+ res.status(data.statusCode).end(utf8Body)
})
})