Skip to content

Commit 4ae86db

Browse files
authored
Merge pull request #12 from tfiwm/feature/https-support
Added https support
2 parents a0e6061 + ae14435 commit 4ae86db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
xhr.onload = function () { callback(JSON.parse(xhr.responseText), xhr.status) }
4848
xhr.send(body)
4949
} else if (typeof require == 'function') {
50-
var http = require('http'), URL = require('url'), uri = URL.parse(url)
51-
var req = http.request({
50+
var http = require('http'), https = require('https'), URL = require('url'), uri = URL.parse(url);
51+
var req = (uri.protocol === 'https:' ? https : http).request({
5252
protocol: uri.protocol,
5353
hostname: uri.hostname,
5454
port: uri.port,

0 commit comments

Comments
 (0)