goto done;
}
+ /* now expected by rgw_log_op() */
+ rgw_env.set("REQUEST_METHOD", s->info.method);
+ rgw_env.set("REQUEST_URI", s->info.request_uri);
+ rgw_env.set("QUERY_STRING", "");
+
/* XXX authorize does less here then in the REST path, e.g.,
* the user's info is cached, but still incomplete */
req->log(s, "authorizing");
else
set_param_str(s, "HTTP_REFERER", entry.referrer);
- std::string uri(s->info.env->get("REQUEST_METHOD"));
- uri.append(" ");
-
- uri.append(s->info.env->get("REQUEST_URI"));
- const char* qs = s->info.env->get("QUERY_STRING");
- if(qs && (*qs != '\0')) {
- uri.append("?");
- uri.append(qs);
+ std::string uri;
+ if (s->info.env->exists("REQUEST_METHOD")) {
+ uri.append(s->info.env->get("REQUEST_METHOD"));
+ uri.append(" ");
}
- uri.append(" ");
- uri.append("HTTP/");
- uri.append(s->info.env->get("HTTP_VERSION"));
+ if (s->info.env->exists("REQUEST_URI")) {
+ uri.append(s->info.env->get("REQUEST_URI"));
+ }
+
+ if (s->info.env->exists("QUERY_STRING")) {
+ const char* qs = s->info.env->get("QUERY_STRING");
+ if(qs && (*qs != '\0')) {
+ uri.append("?");
+ uri.append(qs);
+ }
+ }
+
+ if (s->info.env->exists("HTTP_VERSION")) {
+ uri.append(" ");
+ uri.append("HTTP/");
+ uri.append(s->info.env->get("HTTP_VERSION"));
+ }
entry.uri = std::move(uri);