diff options
Diffstat (limited to 'lib/tasklib.lua')
-rw-r--r-- | lib/tasklib.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/tasklib.lua b/lib/tasklib.lua index f506e34..764750b 100644 --- a/lib/tasklib.lua +++ b/lib/tasklib.lua @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: tasklib.lua,v 1.3 2007-05-30 11:57:10 pixel Exp $ */ +/* $Id: tasklib.lua,v 1.4 2007-06-17 15:24:44 pixel Exp $ */ ]]-- @@ -27,8 +27,15 @@ -- Create some simple bindings for the LuaTask system to hide the various ugly yields. -- -function HttpClient(url) - return coroutine.yield("HttpClient", url) +function HttpClient(url, headers, vars) + if type(headers) == "nil" then + headers = {} + end + if type(vars) == "nil" then + vars = {} + end + headers["User-Agent"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1) Gecko/20061010 Firefox/2.0" + return coroutine.yield("HttpClient", url, headers, vars) end function Command(command, ...) |