You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explicit PROPFIND of getcontenttype returns 404 on folders #13313
When doing a PROPFIND on a folder without a body (no explicitly requested attributes), you'll get the contents of the folder. For every file, there will be a "getcontenttype" attribute containing the mime type. However, folders do not have that attribute.
However if you explicitly request the "getcontenttype" attribute through PROPFIND, you'll get it for files as before, but for folders it will put it in the 404 block. Not sure if this is expected or whether we should add code to prevent this case.
Normally for any attribute that does not exist for an entity, the attribute would be put in the 404 block.
This is expected behavior. Collections don't have a content-type, because a content-type only relates to the Content-Type header of what a GET request would return. Collections don't need to respond to GET requests.
Activity
DeepDiver1975 commentedon Jan 13, 2015
@PVince81 some webdav fun for you? 🙊
PVince81 commentedon Jan 13, 2015
Yes, already discussed with @SergioBertolinSG on IRC.
It seems that folders do not have content types.
When doing a PROPFIND on a folder without a body (no explicitly requested attributes), you'll get the contents of the folder. For every file, there will be a "getcontenttype" attribute containing the mime type. However, folders do not have that attribute.
However if you explicitly request the "getcontenttype" attribute through PROPFIND, you'll get it for files as before, but for folders it will put it in the 404 block. Not sure if this is expected or whether we should add code to prevent this case.
Normally for any attribute that does not exist for an entity, the attribute would be put in the 404 block.
@evert any clue what route to go here ?
evert commentedon Jan 13, 2015
This is expected behavior. Collections don't have a content-type, because a content-type only relates to the
Content-Typeheader of what aGETrequest would return. Collections don't need to respond toGETrequests.PVince81 commentedon Jan 13, 2015
Okay, so the client should simply ignore the fact that "a:getcontenttype" appears in the 404 block, which shouldn't hurt.
Does it mean that if no attributes were requested explicitly (default case), a:getcontenttype should also appear in a 404 block for consistency ?
evert commentedon Jan 13, 2015
No, it doesn't make sense for the 'allprop' case. It may help to read up on
PROPFINDin rfc4918, as afaik, it should answer most of those questions.PVince81 commentedon Jan 13, 2015
Okay, thanks for the clarification.
Closing this as this is the expected behavior.