4 ms·
Weird choice for the uri: http://localhost:8000::dbname http://localhost:8000::dbname Why not http://localhost:8000/dbname http://localhost:8000/dbname ?
by jbverschoor 10y ago
Weird choice for the uri: http://localhost:8000::dbname http://localhost:8000::dbname
Why not http://localhost:8000/dbname http://localhost:8000/dbname ?
- lost_my_pwd 10y agoWow, I missed that. That violates the URI spec, assuming the author(s) were intending to use a URI. https://tools.ietf.org/html/rfc3986 https://tools.ietf.org/html/rfc3986 (see "3.3. Path").
- drostie 10y agoRight, it intentionally violates the URI spec by appending something to the end of it. The data structure they're storing has a natural pair-of-structures at its top level: data Database = InMemory | LevelDB Path | ViaHTTP URL newtype DataSet = DS Text newtype Hash = Hash Text data Accessor = AccessDS DataSet | AccessValue (Either DataSet Hash) Path type DBAccessor = (Database, Accessor) They elected to basically encode a DBAccessor above as a string which you can split on "::", with the URL above being stored on the left in the case of the ViaHTTP databases.
- aboodman 10y agoThe string wasn't originally intended to be a URI, but I've been subsequently convinced that it would be useful for it to be one. We'll change it eventually.
- Kiro 10y agohttps://news.ycombinator.com/item?id=12212967 https://news.ycombinator.com/item?id=12212967