Software /
code /
prosody
Comparison
net/http.lua @ 4977:7006ccbf22a9
Merge with Zash
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 22 Jul 2012 18:47:40 +0100 |
parent | 4963:54e2c83af127 |
parent | 4972:1777271a1ec0 |
child | 5353:8c3f28f5c1c1 |
comparison
equal
deleted
inserted
replaced
4971:bfc52b9137c8 | 4977:7006ccbf22a9 |
---|---|
5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
7 -- | 7 -- |
8 | 8 |
9 local socket = require "socket" | 9 local socket = require "socket" |
10 local mime = require "mime" | 10 local b64 = require "util.encodings".base64.encode; |
11 local url = require "socket.url" | 11 local url = require "socket.url" |
12 local httpstream_new = require "util.httpstream".new; | 12 local httpstream_new = require "util.httpstream".new; |
13 | 13 |
14 local server = require "net.server" | 14 local server = require "net.server" |
15 | 15 |
152 ["Host"] = req.host; | 152 ["Host"] = req.host; |
153 ["User-Agent"] = "Prosody XMPP Server"; | 153 ["User-Agent"] = "Prosody XMPP Server"; |
154 }; | 154 }; |
155 | 155 |
156 if req.userinfo then | 156 if req.userinfo then |
157 headers["Authorization"] = "Basic "..mime.b64(req.userinfo); | 157 headers["Authorization"] = "Basic "..b64(req.userinfo); |
158 end | 158 end |
159 | 159 |
160 if ex then | 160 if ex then |
161 req.onlystatus = ex.onlystatus; | 161 req.onlystatus = ex.onlystatus; |
162 body = ex.body; | 162 body = ex.body; |