Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
http: add url parsing if options are a string
  • Loading branch information
Ryan Phillips committed Jun 22, 2012
1 parent 364d996 commit 1cd1587
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/luvit/http.lua
Expand Up @@ -23,6 +23,7 @@ local osDate = require('os').date
local string = require('string')
local stringFormat = require('string').format
local Object = require('core').Object
local url = require('url')
local END_OF_FILE = 0
local CRLF = '\r\n'
Expand Down Expand Up @@ -1000,6 +1001,9 @@ end
--------------------------------------------------------------------------------
function http.request2(options, callback)
if type(options) == 'string' then
options = url.parse(options)
end
return ClientRequest:new(options, callback)
end
Expand Down

0 comments on commit 1cd1587

Please sign in to comment.