}
}
-void dump_uri_from_state(struct req_state *s)
-{
- if (strcmp(s->info.request_uri.c_str(), "/") == 0) {
-
- string location = "http://";
- string server = s->info.env->get("SERVER_NAME", "<SERVER_NAME>");
- location.append(server);
- location += "/";
- if (!s->bucket_name.empty()) {
- if (!s->bucket_tenant.empty()) {
- location += s->bucket_tenant;
- location += ":";
- }
- location += s->bucket_name;
- location += "/";
- if (!s->object.empty()) {
- location += s->object.name;
- dump_header(s, "Location", location);
- }
- }
- } else {
- dump_header_quoted(s, "Location", s->info.request_uri);
- }
-}
-
void dump_redirect(struct req_state * const s, const std::string& redirect)
{
return dump_header_if_nonempty(s, "Location", redirect);
extern void dump_time(struct req_state *s, const char *name, real_time *t);
extern std::string dump_time_to_str(const real_time& t);
extern void dump_bucket_from_state(struct req_state *s);
-extern void dump_uri_from_state(struct req_state *s);
extern void dump_redirect(struct req_state *s, const string& redirect);
extern bool is_valid_url(const char *url);
extern void dump_access_control(struct req_state *s, const char *origin,