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.

host + port is recognised as protocol

See original GitHub issue
hasProtocol('localhost:3000')
// true

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shtse8commented, Aug 25, 2022

How do you think about solution? Technically something like mailto:3000@example.com is also valid protocol.

this is valid urn protocol, but not uri, maybe we can allow user to specific uri or urn in hasProtocol options? Probably it’s hard to do it in smart way.

tested with urijs (the largest uri package in npm), same issue found.

new URI('localhost:3000').protocol()
// 'localhost'
0reactions
pi0commented, Aug 25, 2022

This kind of input is basically host (${hostname}:${port}) which we implicitly accept as valid input for various ufo utils. Sticking with a strict URL parser, it is true that behavior returns localhost as a scheme but this is kinda the DX point of ufo utils over using raw URL to allow more versatility on common inputs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About the USB Protocol, Common USB Bus Errors, and How ...
In a normal USB transaction, host and peripherals send and receive data, acknowledging (ACK) or denying (NAK) certain transactions, allowing ...
Read more >
MSA change host-port-mode - HPE Community
The host uses the iSCSI or FC protocol to see the storage volumes. Storage volumes created from RAID still reside on the MSA....
Read more >
USB Operation: Protocol, Data Transfer & Packets
Host : The host is the computer or item that acts as the main element or controller for the USB system. · Hub:...
Read more >
USB Protocol in Depth – Framework Layer - LinkedIn
When a USB device is attached to or removed from the USB, the host uses a process known as bus enumeration to identify...
Read more >
USB in a NutShell - Chapter 3 - USB Protocols - Beyondlogic
As we have already discussed, USB is a host centric bus. The host initiates all transactions. The first packet, also called a token...
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