mirror of
https://github.com/remy/inliner.git
synced 2024-09-11 17:25:30 +03:00
Add support for ports other than 80 so it can work with things like servedir, for instance :)
This commit is contained in:
parent
245541fd01
commit
e8dda224a2
@ -7,7 +7,7 @@ var URL = require('url'),
|
||||
function get(url, callback) {
|
||||
var oURL = URL.parse(url),
|
||||
http = require('http'),
|
||||
client = http.createClient(80, oURL.hostname),
|
||||
client = http.createClient(oURL.port || 80, oURL.hostname),
|
||||
request = client.request('GET', oURL.pathname, {'host': oURL.hostname});
|
||||
|
||||
request.end();
|
||||
@ -27,7 +27,7 @@ function get(url, callback) {
|
||||
function img2base64(url, callback) {
|
||||
var oURL = URL.parse(url),
|
||||
http = require('http'),
|
||||
client = http.createClient(80, oURL.hostname),
|
||||
client = http.createClient(oURL.port || 80, oURL.hostname),
|
||||
request = client.request('GET', oURL.pathname, {'host': oURL.hostname});
|
||||
|
||||
request.end();
|
||||
|
Loading…
Reference in New Issue
Block a user