Skip to content
Permalink
Browse files

http: add url parsing if options are a string

  • Loading branch information...
Ryan Phillips
Ryan Phillips committed Jun 22, 2012
1 parent 364d996 commit 1cd1587e945f6a61dffa75c2ac12f15eafa83ae1
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/luvit/http.lua
@@ -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'
@@ -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

0 comments on commit 1cd1587

Please sign in to comment.
You can’t perform that action at this time.