[tahoe-dev] help: how should you tell a web browser what name to use for a file?

Brian Warner warner-tahoe at allmydata.com
Wed May 14 13:30:43 PDT 2008


> I proposed

Good point. So:


 1: /named/FILECAP/FILENAME
    (where "named" might be spelled differently)

 2: /cap/(FILECAP|DIRCAP+PATH)/$MAGIC/FILENAME
    2a: $MAGIC = "", rejected because "//" feels dubious
    2b: $MAGIC = "@@name="

 3: /cap/(FILECAP|DIRCAP+PATH)/FILENAME
    (i.e. any attempt to lookup a "child of a file" results in the same file)

 4: /named/FILECAP/$MAGIC/FILENAME
    (where "named" might be spelled differently)
    and $MAGIC = "@@name="

So yeah, #4 doesn't affect the dirnode namespace at all. I'm ok with that.



 #1: http://127.0.0.1:8123/named/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202/welcome.txt

 #2a: http://127.0.0.1:8123/uri/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202//welcome.txt

 #2b: http://127.0.0.1:8123/uri/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202/@@name=/welcome.txt

 #3: http://127.0.0.1:8123/uri/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202/welcome.txt

 #4: http://127.0.0.1:8123/named/URI%3ACHK%3Aime6pvkaxuetdfah2p2f35pe54%3A4btz54xk3tew6nd4y2ojpxj4m6wxjqqlwnztgre6gnjgtucd5r4a%3A3%3A10%3A202/@@name=/welcome.txt

I'd be tempted to implement #4 by saying that once the Resource.getChild
traversal mechanism has seen /named/FILECAP, it should just ignore every
remaining path component. That's easy to code up. It would also mean that
/named/FILECAP/blah/blah/blah/foo.txt would work just as well as
/named/FILECAP/@@name=/foo.txt and /named/FILECAP/foo.txt . This
implementation would accept both #1 and #4 style URLs: it would be a matter
of convention that our WUI pages provide $MAGIC = /@@name=/ .

If you're ok with this, I'll implement it.

 -Brian


More information about the tahoe-dev mailing list