Skip to content

Commit

Permalink
fix double substitution in local environment introduced in commit f5b…
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Oct 26, 2011
1 parent 5b403eb commit d4814ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/configuration.js
Expand Up @@ -154,13 +154,13 @@ g_config['URL'] = g_config['scheme'] + '://' + g_config['hostname'] + getPortFor
* to re-write urls as needed for this particular environment.
*
* Note, for a 'local' environment, no re-write is needed because this is
* handled at a higher level. For a 'production' env no rewrite is necc cause
* all source files are written for that environment.
* handled at a higher level. For other environments, only perform re-writing
* if the host, port, or scheme are different than https://browserid.org:443
* (all source files always should have the production hostname written into them)
*/
exports.performSubstitution = function(app) {
if (g_config.hostname != 'browserid.org' ||
g_config.port != '443' ||
g_config.scheme != 'https') {
if ((g_config.hostname != 'browserid.org' || g_config.port != '443' || g_config.scheme != 'https') &&
process.env['NODE_ENV'] !== 'local'){
app.use(substitution.substitute({
'https://browserid.org': g_config['URL'],
'browserid.org:443': g_config['hostname'] + ':' + g_config['port'],
Expand All @@ -171,7 +171,7 @@ exports.performSubstitution = function(app) {

// At the time this file is required, we'll determine the "process name" for this proc
// if we can determine what type of process it is (browserid or verifier) based
// on the path, we'll use that, otherwise we'll name it 'ephemeral'.
// on the path, we'll use that, otherwise we'll name it 'ephemeral'.
if (process.argv[1] == path.join(__dirname, "..", "browserid", "run.js")) {
g_config['process_type'] = 'browserid';
} else if (process.argv[1] == path.join(__dirname, "..", "verifier", "run.js")) {
Expand Down

0 comments on commit d4814ed

Please sign in to comment.