Permalink
Browse files

[minor dist] s/if(/if (/

  • Loading branch information...
1 parent 72a3133 commit 6977d6aa479ec9db7ffb5def33942b2558945f2e @indexzero indexzero committed Nov 20, 2013
Showing with 8 additions and 8 deletions.
  1. +1 −1 examples/after/index.js
  2. +3 −3 lib/core.js
  3. +4 −4 lib/response-stream.js
View
@@ -4,7 +4,7 @@ var fs = require('fs'),
var server = union.createServer({
before: [ function (req,res) {
- if(req.url === "/foo") {
+ if (req.url === "/foo") {
res.text(201, "foo");
}
} ],
View
@@ -55,13 +55,13 @@ core.createServer = function (options) {
//
if (options.https || options.spdy) {
- if(options.https && options.spdy){
+ if (options.https && options.spdy){
throw new Error('You shouldn\'t be using https and spdy simultaneously.')
}
var key, serverOptions, credentials;
- if(options.spdy) {
+ if (options.spdy) {
key = 'spdy';
} else {
key = 'https';
@@ -82,7 +82,7 @@ core.createServer = function (options) {
credentials.ca = fs.readFileSync(serverOptions.ca);
}
- if(options.spdy){
+ if (options.spdy){
// spdy is optional so we require module here rather than on top
var spdy = require('spdy');
return spdy.createServer(credentials, requestHandler);
View
@@ -163,15 +163,15 @@ ResponseStream.prototype.write = function (data) {
ResponseStream.prototype.redirect = function(path, status) {
var url = '';
-
- if(~path.indexOf('://')) {
+
+ if (~path.indexOf('://')) {
url = path;
} else {
url += this.req.connection.encrypted ? 'https://' : 'http://';
url += this.req.headers.host;
- url += (path[0] === '/') ? path : '/' + path;
+ url += (path[0] === '/') ? path : '/' + path;
}
-
+
this.res.writeHead(status || 302, { 'Location': url });
this.end();
};

0 comments on commit 6977d6a

Please sign in to comment.