Re: new issue: requirements on dav:error responses

Wilfredo Sánchez Vega schrieb:
>   My server does, in fact, return XML for (eg. ACL) errors to GET, and, 
> of course, it looks kinda stupid in my browser.  In this case:
> 
> <?xml version='1.0' encoding='UTF-8'?>
> <error xmlns='DAV:'>
>   <need-privileges>
>     <resource>
>       <href>/principals/user/wsanchez</href>
>       <privilege>
>         <read/>
>       </privilege>
>     </resource>
>   </need-privileges>
> </error>
> 
>   The browser simply shows the string "/principals/user/wsanchez".
> 
>   I'm not terribly excited about returning HTML instead, however, since 
> that's less useful for my primary clients.  If I did, I'd do it based on 
> user-agent strings, which is stupid in other ways, but at least only 
> exposes HTML to (the subset of) clients that I know don't care about the 
> XML error.
> 
>   Instead, I was wondering recently whether inserting an XSL stylesheet 
> into the DAV XML response would help here.  It would be one of those 
> <?blah?> elements:
> 
> <?xml version='1.0' encoding='UTF-8'?>
> <?xml-stylesheet type="text/xsl" href="foo.xsl"?>
> <error xmlns='DAV:'>
>   <need-privileges>
>     <resource>
>       <href>/principals/user/wsanchez</href>
>       <privilege>
>         <read/>
>       </privilege>
>     </resource>
>   </need-privileges>
> </error>
> 
>   I don't really have clue enough yet to write a stylesheet, but it 
> seems like it might work...
> 
>   (Yes, I'd be happy enough even if it means that browsers that don't 
> understand XSL stylesheets remain broken.)

That's actually a very good idea. I personally wouldn't worry about 
non-XSLT aware browsers anymore. The good question is whether browsers 
do the "right thing" even if the status code wasn't 2xx.

Something to try out. But I'd still rather not require servers to do that.

Best regards, Julian

Received on Wednesday, 29 November 2006 00:18:56 UTC