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;
|
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.
|
// We already have /api/v1/ on the URLs, so remove them from the paths.
|
||||||
path = path.substr('/api/v1/'.length, path.length);
|
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;
|
return url;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1155,8 +1160,8 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
var path = resource['path'];
|
var path = resource['path'];
|
||||||
|
|
||||||
// Add the operation itself.
|
// Add the operation itself.
|
||||||
apiService[operationName] = function(opt_options, opt_parameters, opt_background) {
|
apiService[operationName] = function(opt_options, opt_parameters, opt_background, opt_forcessl) {
|
||||||
var one = Restangular.one(buildUrl(path, opt_parameters));
|
var one = Restangular.one(buildUrl(path, opt_parameters, opt_forcessl));
|
||||||
if (opt_background) {
|
if (opt_background) {
|
||||||
one.withHttpConfig({
|
one.withHttpConfig({
|
||||||
'ignoreLoadingBar': true
|
'ignoreLoadingBar': true
|
||||||
|
|
Reference in a new issue