scripts/framework/HTTP.js ignores port parameter and protocoll
johannesgerer opened this issue · comments
Johannes Gerer commented
- the protocoll is complete ignored, so you change you example (which uses http://host into just "host")
As only http:// seems to be possible on APE that would be enough for now. - If no port is given in the url via url:port, then the port is always set to 80 even if one is given in the constructor!
My fix is to have he following priority: Constructor Agrument or, if none given: port in url, or if none given: 80
initialize: function(url, port) {
this.url = url;
this.port = port;
this.parseURL();
},
parseURL: function() {
var result = this.url.match("^.*?://(.*?)(:([0-9]+))?((/.*)|)$");
this.host = result[1];
this.port = this.port || result[3] || 80;
this.query = result[4];
},