Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minify #541

Merged
merged 3 commits into from
Mar 11, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion node/utils/Minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ function getAceFile(callback) {
var request = require('request');

var baseURI = 'http://localhost:' + settings.port
var resourceURI = baseURI + path.normalize(path.join('/static/', filename));
resourceURI = resourceURI.replace(/\\/g, '/'); // Windows (safe generally?)

request(baseURI + path.normalize(path.join('/static/', filename)), function (error, response, body) {
request(resourceURI, function (error, response, body) {
if (!error && response.statusCode == 200) {
data += 'Ace2Editor.EMBEDED[' + JSON.stringify(filename) + '] = '
+ JSON.stringify(body || '') + ';\n';
Expand Down
4 changes: 2 additions & 2 deletions node/utils/caching_middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CachingMiddleware.prototype = new function () {
var modifiedSince = (req.headers['if-modified-since']
&& new Date(req.headers['if-modified-since']));
var lastModifiedCache = !error && stats.mtime;
if (lastModifiedCache) {
if (lastModifiedCache && responseCache[cacheKey]) {
req.headers['if-modified-since'] = lastModifiedCache.toUTCString();
} else {
delete req.headers['if-modified-since'];
Expand Down Expand Up @@ -83,7 +83,7 @@ CachingMiddleware.prototype = new function () {
&& new Date(res.getHeader('last-modified')));

res.writeHead = old_res.writeHead;
if (status == 200 || status == 404) {
if (status == 200) {
// Update cache
var buffer = '';

Expand Down