solid / solid-spec

Solid specification draft 0.7.0
Creative Commons Zero v1.0 Universal
1.13k stars 103 forks source link

Nasty URL encoding of "ids" #154

Closed happy-dev closed 5 years ago

happy-dev commented 5 years ago

In the Solid world, ids are URLs, it is one of the key principles.

Then if my application displays Tim's profile, to check out his topless pics, in a classical world I would have something like : https://my-app/profile/timbl or https://my-app/profile/32 Elegant right ?!

But in a Solid world, ids are URL so I end-up with the ugly and problematic : https://my-app/profile/https%3A%2F%2Fwww.w3.org%2FPeople%2FBerners-Lee%2Fcard

Two problems here :

So... what do you think ?

If you want to read our script kiddies solution so far, it is all here : https://git.happy-dev.fr/startinblox/framework/sib-router/issues/27

gobengo commented 5 years ago

Do you have the same concern if you parse the url out of a query string parameter instead of some segment of the url path?

Sent from my iPhone

On Apr 6, 2019, at 4:43 PM, happy-dev notifications@github.com wrote:

In the Solid world, ids are URLs, it is one of the key principles.

Then if my application displays Tim's profile, to check out his topless pics, in a classical world I would have something like : https://my-app/profile/timbl or https://my-app/profile/32 Elegant right ?!

But in a Solid world, ids are URL so I end-up with the ugly and problematic : https://my-app/profile/https%3A%2F%2Fwww.w3.org%2FPeople%2FBerners-Lee%2Fcard

Two problems here :

Ugly as f*** right ?! I know we can pretend URLs aren't supposed to be handled by humans and all but... it is not true ! The whole thing just looks like the app just crashed. I thought for weeks we had a bug in our router before asking why it was unreadable like that. Apache doesn't like it either, and we surely can't rebuild the web without Apache, right ?! https://stackoverflow.com/a/3235361/877353 So... what do you think ?

If you want to read our script kiddies solution so far, it is all here : https://git.happy-dev.fr/startinblox/framework/sib-router/issues/27

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

happy-dev commented 5 years ago

@gobengo : I believe yes. My understand is that Apache doesn't distinguish between the parameters and the rest of the URL regarding %2F.

Regarding UX I don't believe it has an influence.

namedgraph commented 5 years ago

@happy-dev https://httpd.apache.org/docs/2.4/mod/core.html#allowencodedslashes

happy-dev commented 5 years ago

@namedgraph : I know, but I am not sure we can assume everyone will have this parameter turned on. Maybe that answers the question though. Dirty URLs and AllowEncodedSlashes ON : problem solved !

angelo-v commented 5 years ago

not sure we can assume everyone will have this parameter turned on

Why is it necessary that everybody has turned this on? If your app runs on apache and relies on it, turn it on. E.g. the apps I build only use client side routing and do not have any issues with URL encoding, see https://profiles.veltens.org/profile?webId=https%3A%2F%2Fangelo.veltens.org%2Fprofile%2Fcard%23me

Yes, it is ugly, but I do not see any way to circumvent this. Perhaps eventually Browsers will be aware of this and display it more nicely, like "App URL: ..., Data URL: ..."

happy-dev commented 5 years ago

@angelo-v : Indeed, in my mind it meant no shared hosting but we can override settings via .htaccess so I guess this is not an issue.

I agree with you that we can make do with the ugliness of it for now and that a solution will appear at some point.

sylvainlb commented 5 years ago

In the end we're going for our own encoding scheme:

We'd rather go for a standard solution but we couldn't find one.