Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix content-type:; console.error -> console.warn

  • Loading branch information...
commit 9915fd86894af038ee24107e63c9b3209871a6dc 1 parent c95e703
user authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/jsgi/transporter.js
View
16 lib/jsgi/transporter.js
@@ -1,4 +1,4 @@
-//TODO: optionally write to target file
+//TODO: optionally write to target file
exports.Transporter = function(options, app) {
var options = options || {},
prefix = options.urlPrefix || "/lib/",
@@ -33,9 +33,7 @@ exports.Transporter = function(options, app) {
}
return {
status: 404,
- headers: {
- "Content-Type": "application/javascript"
- },
+ headers: {},
body: ["Not found"]
};
}
@@ -51,7 +49,9 @@ exports.Transporter = function(options, app) {
modules = {};
return {
status: 200,
- headers: {},
+ headers: {
+ "Content-Type": "application/javascript"
+ },
body: {
forEach: function(write){
if(converter.start){
@@ -101,7 +101,7 @@ exports.Transporter = function(options, app) {
if(modules[moduleName]){
if(modules[moduleName] === 1 && !isPaused && write && !converter.start){
// we need to pause to get all the dependencies loaded
- write("require.pause();\n");
+ write("require.pause();\n");
isPaused = true;
}
return true;
@@ -111,11 +111,11 @@ exports.Transporter = function(options, app) {
var fileContents = loader(moduleName + ".js");
}
catch(e){
- errors.push('console.error(' + JSON.stringify(moduleName) + ' + " could not be loaded: " + ' + JSON.stringify(e.message) + ');\n');
+ errors.push('console.warn(' + JSON.stringify(moduleName) + ' + " could not be loaded: " + ' + JSON.stringify(e.message) + ');\n');
return;
}
if(!fileContents && write){
- errors.push('console.error(' + JSON.stringify(moduleName) + ' + " not found");\n');
+ errors.push('console.warn(' + JSON.stringify(moduleName) + ' + " not found");\n');
return;
}
if(moduleName === "require"){
Please sign in to comment.
Something went wrong with that request. Please try again.