# HG changeset patch # User Kim Alvefur # Date 1570902157 -7200 # Node ID 53fc4b612fb2035ad0f45f5780acd205e11bd9b9 # Parent 0a0bf87ccda636eee83d61ffdd9a887854e992b9 mod_http_upload: Skip custom HEAD handling on recent Prosody trunk diff -r 0a0bf87ccda6 -r 53fc4b612fb2 mod_http_upload/mod_http_upload.lua --- a/mod_http_upload/mod_http_upload.lua Sat Oct 12 16:22:54 2019 +0200 +++ b/mod_http_upload/mod_http_upload.lua Sat Oct 12 19:42:37 2019 +0200 @@ -17,6 +17,7 @@ local t_concat = table.concat; local t_insert = table.insert; local s_upper = string.upper; +local httpserver = require "net.http.server"; local have_id, id = pcall(require, "util.id"); -- Only available in 0.10+ local uuid = require"util.uuid".generate; if have_id then @@ -383,6 +384,11 @@ return serve_uploaded_files(event, path); end +if httpserver.send_head_response then + -- Prosody will take care of HEAD requests since hg:3f4c25425589 + serve_head = nil +end + local function serve_hello(event) event.response.headers.content_type = "text/html;charset=utf-8" return "\n

Hello from mod_"..module.name.." on "..module.host.."!

\n";