Permalink
Browse files

Moved private functions to the bottom.

  • Loading branch information...
1 parent af11702 commit 19af4809a6d79859ea476e4a00e4de5e10707eb2 @cskr committed Jan 25, 2011
Showing with 18 additions and 18 deletions.
  1. +18 −18 grasshopper/lib/context.js
@@ -87,17 +87,6 @@ function RequestContext(request, response, secure) {
this.charset = defaultCharset;
}
-RequestContext.prototype._getExtn = function() {
- var extn = defaultViewExtn;
- var path = url.parse(this.request.url).pathname;
- if(path.match(/\.[^\/]+$/)) {
- extn = path.substring(path.lastIndexOf('.') + 1);
- this.requestExtn = extn;
- }
-
- return extn;
-};
-
RequestContext.prototype.challengeAuth = function(type, options) {
var challengeHeader = type + ' ';
Object.keys(options).forEach(function(key) {
@@ -242,13 +231,6 @@ RequestContext.prototype.redirect = function(location, cb) {
}
};
-RequestContext.prototype._writeHead = function() {
- if(this.charset) {
- this.headers['content-type'] += '; charset=' + this.charset
- }
- this.response.writeHead(this.status, this.headers);
-};
-
RequestContext.prototype.disableCache = function() {
this.headers['expires'] = 'Thu, 11 Mar 2010 12:48:43 GMT';
this.headers['cache-control'] = 'no-store, no-cache, must-revalidate';
@@ -339,6 +321,24 @@ RequestContext.prototype.endSession = function(callback) {
});
};
+RequestContext.prototype._getExtn = function() {
+ var extn = defaultViewExtn;
+ var path = url.parse(this.request.url).pathname;
+ if(path.match(/\.[^\/]+$/)) {
+ extn = path.substring(path.lastIndexOf('.') + 1);
+ this.requestExtn = extn;
+ }
+
+ return extn;
+};
+
+RequestContext.prototype._writeHead = function() {
+ if(this.charset) {
+ this.headers['content-type'] += '; charset=' + this.charset
+ }
+ this.response.writeHead(this.status, this.headers);
+};
+
RequestContext.prototype._renderStatic = function() {
if(this.request.method != 'GET' && this.request.method != 'HEAD') {
this.extn = defaultViewExtn;

0 comments on commit 19af480

Please sign in to comment.