Skip to content

TypeError: Invalid URL #1342

@tyanbiao

Description

@tyanbiao

Reproduction

Steps to reproduce the behavior:

  1. use node-fetch to request url https://r2---sn-n4v7sney.googlevideo.com
  2. throw error: TypeError: Invalid URL

You can try to reproduce the issue by running the code below

const fetch = require('node-fetch')

async function getAudio() {
    const ret = await fetch('https://r2---sn-n4v7sney.googlevideo.com')
    const text = await ret.text()
    return text
}

getAudio().catch(e => console.error(e))

Expected behavior

https://r2---sn-n4v7sney.googlevideo.com is a valid url

Screenshots

temp

Your Environment

software version
node-fetch 2.6.5
node v14.18.1
npm 6.14.15
Operating System Windows 10

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions