Skip to content

infinite loop in findURI with tld and no trailing / #161

@macgyver

Description

@macgyver

Description

if you do not include a trailing slash after the tld in your domain, claycli enters an infinite loop.
https://nymag.com is a valid url (new URL('https://nymag.com') returns a valid URL object) but using it as input for findURI enters an infinite loop.

Steps to Reproduce

clayrest = require('claycli/lib/rest')
clayrest.findURI('http://nymag.com').pluck('uri').pipe(process.stdout)
// client hangs

Expected Behavior

The same result as if I had included the trailing slash in the URL

clayrest = require('claycli/lib/rest')
clayrest.findURI('http://nymag.com/').pluck('uri').pipe(process.stdout)
// returns the page uri of the current homepage `nymag.com/_pages/homepage`

Screenshots

If applicable, add screenshots to help explain your problem.

Specs

Desktop

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional Context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions