Re: [whatwg] Zip archives as first-class citizens

On Wed, Aug 28, 2013 at 8:04 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 8/28/13 9:32 AM, Anne van Kesteren wrote:
>>
>> I'm not sure we need to consider sub-scheme if zip-path can work as
>> it's more complex and not very well thought out. E.g. imagine
>> view-source:zip:http://www.example.org/zip!test.html.
>
>
> What's the issue with that?  Gecko supports that (with jar:, not zip:),
> fwiw.

I have two concerns with the scheme-based approach.

* It dramatically complicates origin handling. This is something we've
seen multiple times in gecko and something that I expect authors will
struggle with too.

* It makes it impossible to have create a relative URL from inside the
zip file to refer to something on the same server but outside of the
zip file. Since anything outside of the zip file uses a different
scheme, it means that you have to use an absolute URL. Not even URLs
starting with "/" nor "//" can be used.

> 3)  We have implementation experience with the "sub-scheme" approach and we
> know it can work just fine (existence proof is jar: in Gecko).  The main
> difficulty it introduces is that computing the origin needs to be done via
> object accessors, not string-parsing...  Do we have any implementation
> experience with "zip-path"-like approaches?

I don't know about "can work just fine". Sure, if everyone does the
right thing, then it works. But we're having to strictly enforce that
no one does string parsing by hand and instead use URL objects and
Principal objects. Neither of which really are an option on the web
right now as all URL-related APIs use strings.

> I don't think relative URIs should ever escape a zip archive (though I do
> appreciate the way that would let someone replace directories with zipped-up
> versions of those directories).  The reason for that is that allowing it
> sometimes but not others seems really weird to me, and it seems like we
> don't want to allow it for toplevel zip archives.

Why not?

/ Jonas

Received on Wednesday, 28 August 2013 16:21:39 UTC