Skip to content

Cannot read property 'startsWith' of undefined #998

@cesargdm

Description

@cesargdm

Describe the bug

  • Node.js version: v10.15.3
  • OS & version: macOS 10.15.1
  • Got: version 10.0.4

When trying to make a POST request to https://www.google.com I get an error using version 10.0.4 but getting back to version 9.0.4 returns a correct response.

Actual behavior

When trying to make a POST request to https://www.google.com I get the error

{ GotError: Cannot read property 'startsWith' of undefined
    at get (/Users/cesargdm/Development/Sites/fucesa-cloud/node_modules/got/dist/source/request-as-event-emitter.js:200:27)
    at urlToOptions (internal/url.js:1259:28)
    at Object.request (https.js:271:15)
    at Object.request (/usr/local/lib/node_modules/serverless/node_modules/agent-base/patch-core.js:23:20)
    at get (/Users/cesargdm/Development/Sites/fucesa-cloud/node_modules/got/dist/source/request-as-event-emitter.js:197:43) code: undefined, name: 'RequestError' }

Expected behavior

Don't throw error,

Code to reproduce

got.post('https://www.google.com')

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions