From 201fb4d73e67c21c3823d2a75f71e0340fd7294e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 3 Sep 2013 13:20:19 -0400 Subject: [PATCH] fixed #256 - where saving and retrieval of RSS feeds wasn't working on some instances due to a relative path being passed to read/writeFile --- src/webserver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index 0c5f9b5b54..2ec1ec2feb 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -212,7 +212,7 @@ var express = require('express'), var tid = req.params.topic_id; if (tid.match(/^\d+\.rss$/)) { - fs.readFile('feeds/topics/' + tid, function (err, data) { + fs.readFile(path.join(__dirname, '../', 'feeds/topics', tid), function (err, data) { if (err) { res.type('text').send(404, "Unable to locate an rss feed at this location."); return; @@ -280,7 +280,7 @@ var express = require('express'), var cid = req.params.category_id; if (cid.match(/^\d+\.rss$/)) { - fs.readFile('feeds/categories/' + cid, function (err, data) { + fs.readFile(path.join(__dirname, '../', 'feeds/categories', cid), function (err, data) { if (err) { res.type('text').send(404, "Unable to locate an rss feed at this location."); return;