question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am reporting: a bug or unexpected behavior.

Bug Report

I’m working on resolving https://github.com/ssbc/ssb-markdown/issues/25 and noticed that some Dat URIs don’t currently conform to URI syntax. URLs like dat://example.com are great, but when linking to a hash the // should be removed, otherwise it’s parsed as a host (which has a maximum of 63 characters).

800px-uri_syntax_diagram

Instead, I think hash links should be presented (and parsed) as a path section rather than as a host. The only required change is to remove // from the URI when there’s no host.

Expected behavior

64-character hash links should start with dat: rather than dat://.

Actual behavior

64-character hash links start with dat://, so URI parsers throw an error as that’s not a valid host.


Thanks, I appreciate your help on this! Please let me know if there’s any other information I can provide.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
christianbundycommented, Nov 28, 2018

This was discussed a bit more in IRC and it sounds like there are other deviations from the URI spec (like dat://hash+version, which is an invalid hostname). From my perspective, the main takeaway was:

at some point, we just have to make a choice and live with the warts. I’ll need much bigger warts before I suggest changing the URL spec

It sounds like parse-dat-url has a way of parsing Dat identifiers, but since they aren’t URIs they aren’t going to be compatible with any standard parsers. I’m a bit bummed that Dat identifiers aren’t URIs or URLs but I’ll cross my fingers that we have the resources to make that change down the road.

Really excited to see all of the great work being done with Dat, thanks! ❤️ 🎉

1reaction
vitoriocommented, Jun 8, 2019

Just a reminder that adding a slash (dat:///hash) is valid, making the host “local” (arguably so in a P2P system) and moves the hash into the path (where length and parsing can be more flexible). You could also remove the slashes (dat:hash).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uniform Resource Identifier - Wikipedia
A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or physical resource used by web technologies.
Read more >
Universal Resource identifiers in WWW
A Universal Resource Identifier (URI) is a member of this universal set of names in registered name spaces and addresses referring to registered...
Read more >
What is a Uniform Resource Identifier (URI)? - TechTarget
A Uniform Resource Locator (URL), or web address, is the most common form of URI. It is used for unambiguously identifying and locating...
Read more >
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
In other words, the URI generic syntax is a superset of the syntax of all URI schemes. Berners-Lee, et al. Standards Track [Page...
Read more >
URI vs URL: Differences and When to Use Them - Hostinger
URI is an acronym for a Uniform Resource Identifier. URL is an acronym for a Uniform Resource Locator. URI is the superset of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found