Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 2065:624e3fed6f92
mod_http_upload: Trim trailing whitespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 07 Mar 2016 13:47:13 +0100 |
parents | 40056a27f394 |
children | cb74e4ab13f0 |
comparison
equal
deleted
inserted
replaced
2064:2a82c55762a7 | 2065:624e3fed6f92 |
---|---|
1 -- mod_http_upload | 1 -- mod_http_upload |
2 -- | 2 -- |
3 -- Copyright (C) 2015 Kim Alvefur | 3 -- Copyright (C) 2015 Kim Alvefur |
4 -- | 4 -- |
5 -- This file is MIT/X11 licensed. | 5 -- This file is MIT/X11 licensed. |
6 -- | 6 -- |
7 -- Implementation of HTTP Upload file transfer mechanism used by Conversations | 7 -- Implementation of HTTP Upload file transfer mechanism used by Conversations |
8 -- | 8 -- |
9 | 9 |
10 -- imports | 10 -- imports |
11 local st = require"util.stanza"; | 11 local st = require"util.stanza"; |
128 | 128 |
129 local function send_response_sans_body(response, body) | 129 local function send_response_sans_body(response, body) |
130 if response.finished then return; end | 130 if response.finished then return; end |
131 response.finished = true; | 131 response.finished = true; |
132 response.conn._http_open_response = nil; | 132 response.conn._http_open_response = nil; |
133 | 133 |
134 local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]); | 134 local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]); |
135 local headers = response.headers; | 135 local headers = response.headers; |
136 body = body or response.body or ""; | 136 body = body or response.body or ""; |
137 headers.content_length = #body; | 137 headers.content_length = #body; |
138 | 138 |