Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug Fixes

  • Loading branch information...
commit 82f409686e12923dceb16c5b4bf9221e55d27a4b 1 parent a9a6825
Marco Palladino authored September 06, 2011
2  configuration/constants.js
@@ -22,7 +22,7 @@
22 22
  *
23 23
  */
24 24
 
25  
-var BASE_API_PATH = "/mashape-api";
  25
+var BASE_API_PATH = "/mashape-services";
26 26
 
27 27
 exports.paths = {
28 28
 	MASHAPE_PLUGIN_PATH : "/plugins/mashape-plugin.js",
11  mashape-proxy.js
@@ -43,6 +43,7 @@ var count = 0;
43 43
 
44 44
 var ssl_key = null;
45 45
 var ssl_cert = null;
  46
+var ssl_intermediate = null;
46 47
 
47 48
 proxy_configuration.loadConfiguration(function(configuration) {
48 49
 
@@ -61,7 +62,8 @@ proxy_configuration.loadConfiguration(function(configuration) {
61 62
  	if (configuration.ssl) {
62 63
 		var options = {
63 64
 		  key: ssl_key,
64  
-		  cert: ssl_cert
  65
+		  cert: ssl_cert,
  66
+		  ca: ssl_intermediate
65 67
 		};
66 68
 		
67 69
 		https.createServer(options, function (request, response) {
@@ -80,6 +82,13 @@ function loadSSL(configuration) {
80 82
 		if (!ssl_cert) {
81 83
 			ssl_cert = fs.readFileSync('mashape-proxy-cert.pem');
82 84
 		}
  85
+		try {
  86
+			if (!ssl_intermediate) {
  87
+				ssl_intermediate = fs.readFileSync('mashape-proxy-intermediate.pem');
  88
+			}
  89
+		} catch (e) {
  90
+			log.info("Can't find intermediate SSL Certificate file");
  91
+		}
83 92
 	}
84 93
 }
85 94
 
2  mashape/mashape_usagereport.js
@@ -149,7 +149,7 @@ exports.cleanUpOldActions = function() {
149 149
 		}
150 150
 		
151 151
 		// If the user has no limits set, then delete the action
152  
-	 //	cache.getCache().deleteAction(action);
  152
+	    cache.getCache().deleteAction(action);
153 153
 		
154 154
 		// TODO: If the request is global, support delete of global requests in cache (global request have no publicKey)
155 155
 		
12  utils/url_utils.js
@@ -32,10 +32,6 @@ exports.getUrlParts = function(urlParam) {
32 32
 		
33 33
 	var urlObject = url.parse(urlParam);
34 34
 	result.host = urlObject.hostname;
35  
-	result.port = parseInt(urlObject.port);
36  
-	if (isNaN(result.port)) {
37  
-		result.port = 80;
38  
-	}
39 35
 	result.path = (urlObject.pathname == "/") ? "" : urlObject.pathname;
40 36
 	if (urlObject.protocol == "http:" || urlObject.protocol == "https:") {
41 37
 		result.secure = (string_utils.startsWith(urlObject.protocol, "https")) ? true : false;
@@ -43,6 +39,14 @@ exports.getUrlParts = function(urlParam) {
43 39
 		log.error("Only HTTP or HTTPS are supported");
44 40
 		throw new Error();
45 41
 	}
  42
+	result.port = parseInt(urlObject.port);
  43
+	if (isNaN(result.port)) {
  44
+		if (result.secure) {
  45
+			result.port = 443;
  46
+		} else {
  47
+			result.port = 80;
  48
+		}
  49
+	}
46 50
 		
47 51
 	return result;
48 52
 }

0 notes on commit 82f4096

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