Subject: Getcontentlength & GetContentType

From: "Rickard Falk" <[email-masked]>
Date: Mon, 27 Aug 2001 15:53:16 +0200

What should I respond if a client asks for the properties Getcontentlength or GetContentType on a collection?
The spec states:
"The getcontentlength property MUST be defined on any
   DAV compliant resource that returns the Content-Length header in
   response to a GET."

But it doesn't say, if the value a supposed to be the same as if I perform a 'Get' on that url. The collection itself doesn't normally have a content, so does this mean that if the collection have a default page. That it should return the values of that page? Or if the server is set to send a generated HTML page listing the children, should the values be text/html and the size of that page?

Or have I missed something in the spec?

/Rickard Falk

---

From: "Dylan Barrell" <[email-masked]>
Date: Mon, 27 Aug 2001 10:35:36 -0400

GET on a collection is not covered by DAV. You want to get the contents of a
collection, then do a PROPFIND.

You therefore don't have to maintain those proprties for collections (they
also don't make sense).

--Dylan

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Rickard Falk
> Sent: Monday, August 27, 2001 9:53 AM
> To: [email-masked]
> Subject: Getcontentlength & GetContentType
>
>
> What should I respond if a client asks for the properties
> Getcontentlength or GetContentType on a collection?
> The spec states:
> But it doesn't say, if the value a supposed to be the same as if
> I perform a 'Get' on that url. The collection itself doesn't
> normally have a content, so does this mean that if the collection
> have a default page. That it should return the values of that
> page? Or if the server is set to send a generated HTML page
> listing the children, should the values be text/html and the size
> of that page?
>

---

From: "Julian Reschke" <[email-masked]>
Date: Mon, 27 Aug 2001 16:43:15 +0200

WebDAV should still say what it means if a property "must be defined", but
doesn't have a value...

> [mailto:[email-masked]]On Behalf Of Dylan Barrell
> Sent: Monday, August 27, 2001 4:36 PM
> To: Rickard Falk; [email-masked]
> Subject: RE: Getcontentlength & GetContentType
>
>

---

From: "Dylan Barrell" <[email-masked]>
Date: Mon, 27 Aug 2001 11:05:13 -0400

What does it mean to have a property that must be defined, but has no
meaningful value?

It means your spec has a design flaw.

What is an example of such a thing?

--Dylan

> [mailto:[email-masked]]On Behalf Of Julian Reschke
> Sent: Monday, August 27, 2001 10:43 AM
> To: Dylan Barrell; Rickard Falk; [email-masked]

---

From: "Jim Whitehead" <[email-masked]>
Date: Mon, 27 Aug 2001 12:24:19 -0700

> Getcontentlength or GetContentType on a collection?

For DAV:getcontentlength, RFC 2518 states, in section 13.4, that it contains
"the Content-Length header returned by a GET without accept headers."

> I perform a 'Get' on that url.

I'm finding it difficult to see how you came to this interpretation.

> The collection itself doesn't
> page?

Yes, that was the intent for collections.

If you can retrieve the contents of resource R via a GET on URLs collection/
and collection/index.html, then this implied to me that resource R had two
URL mappings. In particular, it meant that a GET on collection/ was
non-zero, and should result in a value for DAV:getcontentlength and
DAV:getcontenttype.

> Or if the server is set to send a generated HTML page

That was also the intent. Now, given the performance implications of this, I
can easily see why a server might not want to compute a value here. Seems
like it would be handy to have a value a server could use to indicate that
the content length is variable, and dynamic, like <d:dynamic/> and thus
allow a server to avoid computing the contents of dynamic resources.

> Or have I missed something in the spec?

Doesn't look like it.

- Jim

---

From: "Jim Whitehead" <[email-masked]>
Date: Mon, 27 Aug 2001 12:24:47 -0700

> WebDAV should still say what it means if a property "must be defined", but

Agreed, I'll add this to the issues list.

Makes sense to me for a server to just give the property an empty value for
these cases.

- Jim

---

From: "Eric Sedlar" <[email-masked]>
Date: Mon, 27 Aug 2001 12:46:54 -0700

<dynamic> would be useful as a return value for any resource that
has contents generated dynamically, like a servlet.  This would be
a REALLY great addition, IMHO.

--Eric

> [mailto:[email-masked]]On Behalf Of Jim Whitehead
> Sent: Monday, August 27, 2001 12:24 PM
> To: [email-masked]

---

From: "Julian Reschke" <[email-masked]>
Date: Mon, 27 Aug 2001 21:50:40 +0200

> Sent: Monday, August 27, 2001 9:25 PM
> To: [email-masked]

At least in the case where the server in fact does not support GET on
properties.