commit 6b9effc38341bfeaab330da9cd05917e67aad76c
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Mar 15 11:37:44 2011 +0100
fix remaining URLs in attribute-listing output to be accurate
* template.c: Adjust the URLs we emit for the body and for each
individual attribute so that they actually work.
* doc/warehouse_api_final.md: Adjust examples to match.
* t/basic: Adjust test to expect new output.
doc/warehouse_api_final.md | 6 +++---
t/basic | 6 +++---
template.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/doc/warehouse_api_final.md b/doc/warehouse_api_final.md
index 31adfe9..f58496b 100644
--- a/doc/warehouse_api_final.md
+++ b/doc/warehouse_api_final.md
@@ -139,9 +139,9 @@ elements as shown here:
$ curl
http://fserver-1:9090/my_bucket/file1
<object>
- <object_body path="http://fserver-1:9090/my_bucket/file1/body"/>
+ <object_body path="http://fserver-1:9090/my_bucket/file1"/>
<object_attr_list
path="http://fserver-1:9090/my_bucket/file1/_attrs"/>
- <object_attr name="xyz"
path="http://fserver-1:9090/my_bucket/file1/attr_xyz"/>
+ <object_attr name="xyz"
path="http://fserver-1:9090/my_bucket/file1/xyz"/>
</object>
The object body can be stored and retrieved using PUT and GET respectively,
@@ -163,7 +163,7 @@ To set both of these attributes at once:
Single-attribute operations are also supported. To fetch a
single attribute:
- $ curl
http://fserver-1:9090/my_bucket/file1/attr_color
+ $ curl
http://fserver-1:9090/my_bucket/file1/color
<attribute name="color">blue</attribute>
The attribute can also be set with a PUT to the same URL.
diff --git a/t/basic b/t/basic
index 010a1a7..fd4bca9 100644
--- a/t/basic
+++ b/t/basic
@@ -177,10 +177,10 @@ test "$(curl $bucket/attr_post/size)" = big || fail=1
cat <<EOF > exp-attr
<object>
- <object_body path="$bucket/attr_post/body"/>
+ <object_body path="$bucket/attr_post"/>
<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_attr name="shape" path="$bucket/attr_post/shape"/>
+ <object_attr name="size" path="$bucket/attr_post/size"/>
</object>
EOF
# Print all attributes of an object:
diff --git a/template.c b/template.c
index f8fb27a..57e52ab 100644
--- a/template.c
+++ b/template.c
@@ -74,13 +74,13 @@ static const char xml_list_footer[] = "\
static const char xml_obj_header[] = "\
<object>\n\
- <object_body path=\"http://%s/%s/%s/body\"/>\n\
+ <object_body path=\"http://%s/%s/%s\"/>\n\
<object_attr_list path=\"http://%s/%s/%s/_attrs\"/>\
";
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/%s\"/>\
";
static const char xml_obj_footer[] = "\