t/basic | 12 ++++++++++++
template.c | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 8a121adcdc378af16f7250b8d0e9643434aeabd4
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Feb 22 11:09:56 2011 +0100
correct typo in object_attr URL: s,http:/,http://,
* template.c (xml_obj_entry): Fix typo.
* t/basic (bucket): Print all attributes of an object.
For now, the object_attr_list and object_attr URLs are
invalid, but that will be fixed shortly.
diff --git a/t/basic b/t/basic
index 808d62a..82005e2 100644
--- a/t/basic
+++ b/t/basic
@@ -172,6 +172,18 @@ curl -d _key=attr_post -d shape=round -d size=big $bucket || fail=1
test "$(curl $bucket/attr_post/shape)" = round || fail=1
test "$(curl $bucket/attr_post/size)" = big || fail=1
+# Print all attributes of an object:
+curl -d op=parts $bucket/attr_post > out-attr || fail=1
+cat <<EOF > exp-attr
+<object>
+ <object_body path="$bucket/attr_post/body"/>
+ <object_attr_list path="$bucket/attr_post/attrs"/>
+ <object_attr name="shape"
path="$bucket/attr_post/attr_shape"/>
+ <object_attr name="size" path="$bucket/attr_post/attr_size"/>
+</object>
+EOF
+compare out-attr exp-attr || fail=1
+
# Ensure that an attempt to add reserved object name fails.
# FIXME: keep this list in sync with the one in rest.c:
# grep '^static.*reserved_name' rest.c
diff --git a/template.c b/template.c
index b3ce671..019dac6 100644
--- a/template.c
+++ b/template.c
@@ -80,7 +80,7 @@ static const char xml_obj_header[] = "\
static const char xml_obj_entry[] = "\
\n\
- <object_attr name=\"%s\" path=\"http:/%s/%s/%s/attr_%s\"/>\
+ <object_attr name=\"%s\" path=\"http://%s/%s/%s/attr_%s\"/>\
";
static const char xml_obj_footer[] = "\
commit 13fe8151f1c86ac2b731f2722780cfa82dec860d
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Feb 22 10:47:07 2011 +0100
do not emit invalid xml for an attribute name
* template.c (xml_obj_entry): For each "<object_attr ",
emit a closing "\>".
diff --git a/template.c b/template.c
index bb0a42a..b3ce671 100644
--- a/template.c
+++ b/template.c
@@ -80,7 +80,7 @@ static const char xml_obj_header[] = "\
static const char xml_obj_entry[] = "\
\n\
- <object_attr name=\"%s\" path=\"http:/%s/%s/%s/attr_%s\"\
+ <object_attr name=\"%s\" path=\"http:/%s/%s/%s/attr_%s\"/>\
";
static const char xml_obj_footer[] = "\
Show replies by date