Add force_ssl support
This commit is contained in:
parent
98d63e00ee
commit
1255cb94ea
1 changed files with 8 additions and 3 deletions
|
@ -977,7 +977,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
return resource;
|
||||
};
|
||||
|
||||
var buildUrl = function(path, parameters) {
|
||||
var buildUrl = function(path, parameters, opt_forcessl) {
|
||||
// We already have /api/v1/ on the URLs, so remove them from the paths.
|
||||
path = path.substr('/api/v1/'.length, path.length);
|
||||
|
||||
|
@ -1017,6 +1017,11 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
}
|
||||
}
|
||||
|
||||
// If we are forcing SSL, return an absolutel URL with an SSL prefix.
|
||||
if (opt_forcessl) {
|
||||
path = 'https://' + window.location.host + '/api/v1/' + path;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
|
@ -1155,8 +1160,8 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
|||
var path = resource['path'];
|
||||
|
||||
// Add the operation itself.
|
||||
apiService[operationName] = function(opt_options, opt_parameters, opt_background) {
|
||||
var one = Restangular.one(buildUrl(path, opt_parameters));
|
||||
apiService[operationName] = function(opt_options, opt_parameters, opt_background, opt_forcessl) {
|
||||
var one = Restangular.one(buildUrl(path, opt_parameters, opt_forcessl));
|
||||
if (opt_background) {
|
||||
one.withHttpConfig({
|
||||
'ignoreLoadingBar': true
|
||||
|
|
Reference in a new issue