Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Support GET and HEAD.

  • Loading branch information...
commit a5365f254748b37eaa1f646a47112dd57d29047c 1 parent a09e208
Chad Weider authored

Showing 2 changed files with 12 additions and 4 deletions. Show diff stats Hide diff stats

  1. +1 1  node/server.js
  2. +11 3 node/utils/Minify.js
2  node/server.js
@@ -155,7 +155,7 @@ async.waterfall([
155 155 });
156 156
157 157 //serve minified files
158   - app.get('/minified/:filename', minify.minifyJS);
  158 + app.all('/minified/:filename', minify.minifyJS);
159 159
160 160 //checks for padAccess
161 161 function hasPadAccess(req, res, callback)
14 node/utils/Minify.js
@@ -85,10 +85,18 @@ function _handle(req, res, jsFilename, jsFiles) {
85 85 res.writeHead(304, {});
86 86 res.end();
87 87 } else {
88   - if (settings.minify) {
89   - respondMinified();
  88 + if (req.method == 'HEAD') {
  89 + res.writeHead(200, {});
  90 + res.end();
  91 + } else if (req.method == 'GET') {
  92 + if (settings.minify) {
  93 + respondMinified();
  94 + } else {
  95 + respondRaw();
  96 + }
90 97 } else {
91   - respondRaw();
  98 + res.writeHead(405, {'allow': 'HEAD, GET'});
  99 + res.end();
92 100 }
93 101 }
94 102 });

0 comments on commit a5365f2

Please sign in to comment.
Something went wrong with that request. Please try again.