Fixes: #6088
Backport: bobtail, cuttlefish, dumpling
When posting an object it is possible to provide a key
name that refers to the original filename, however we
need to verify that in the end we don't end up with an
empty object name.
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit
c8ec532fadc0df36e4b265fe20a2ff3e35319744)
rebuild_key(s->object_str);
+ if (s->object_str.empty()) {
+ err_msg = "Empty object name";
+ return -EINVAL;
+ }
+
env.add_var("key", s->object_str);
part_str("Content-Type", &content_type);