Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol "https:" not supported. Expected "http:". #80

Closed
mattdesl opened this issue Jul 14, 2015 · 0 comments
Closed

Protocol "https:" not supported. Expected "http:". #80

mattdesl opened this issue Jul 14, 2015 · 0 comments
Labels
bug Something does not work as it should

Comments

@mattdesl
Copy link

Take the following:

var url = 'http://github.com/mattdesl/graphics-resources/blob/master/LICENSE.md'
require('got')(url, {
  timeout: 4000
}, function (err, result, res) {
  if (err) {
    console.error('err', err.message)
  } else {
    console.log('result', result)
  }
})

In node 0.10.x it runs, but results in an err saying the request failed.
In node 0.12.7 the method does not run, since it reaches this error before requesting:

_http_client.js:75
    throw new Error('Protocol "' + protocol + '" not supported. ' +
          ^
Error: Protocol "https:" not supported. Expected "http:".
    at new ClientRequest (_http_client.js:75:11)
    at Object.exports.request (http.js:49:10)
    at Object.exports.request (https.js:136:15)
    at get (/projects/npmutils/gh-readme-scrape/node_modules/got/index.js:138:16)
    at ClientRequest.<anonymous> (/projects/npmutils/gh-readme-scrape/node_modules/got/index.js:163:5)
    at ClientRequest.g (events.js:199:16)
    at ClientRequest.emit (events.js:129:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:426:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
    at Socket.socketOnData (_http_client.js:317:20)

I'm guessing it's because the link should actually be:

https://github.com/mattdesl/graphics-resources/blob/master/LICENSE.md

Any ideas how to fix this? Ideally I'd like the http:// request to follow to the https:// url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as it should
Projects
None yet
Development

No branches or pull requests

2 participants