std::string uri = (!s->info.domain.empty()) ? s->info.domain :
[&s]() -> std::string {
RGWEnv const &env(*(s->info.env));
- std::string uri =
- env.get("SERVER_PORT_SECURE") ? "https://" : "http://";
+ std::string uri = rgw_transport_is_secure(s->cct, env) ? "https://" : "http://";
if (env.exists("SERVER_NAME")) {
uri.append(env.get("SERVER_NAME", "<SERVER_NAME>"));
} else {
if (should_redirect) {
const string& hostname = s->info.env->get("HTTP_HOST", "");
const string& protocol =
- (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
+ (rgw_transport_is_secure(s->cct, *s->info.env) ? "https" : "http");
int redirect_code = 0;
rrule.apply_rule(protocol, hostname, key_name, &s->redirect,
&redirect_code);
if (should_redirect) {
const string& hostname = s->info.env->get("HTTP_HOST", "");
const string& protocol =
- (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
+ (rgw_transport_is_secure(s->cct, *s->info.env) ? "https" : "http");
int redirect_code = 0;
rrule.apply_rule(protocol, hostname, original_object_name,
&s->redirect, &redirect_code);