Software /
code /
prosody
Comparison
net/http/server.lua @ 13261:7c62370dee9a
net.http.server: Fix typo in previous commit
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 23 Sep 2023 15:48:21 +0200 |
parent | 13260:da21185fd026 |
comparison
equal
deleted
inserted
replaced
13260:da21185fd026 | 13261:7c62370dee9a |
---|---|
109 log("error", "Traceback[httpserver]: %s", err); | 109 log("error", "Traceback[httpserver]: %s", err); |
110 local response = { headers = { content_type = "text/plain" }; body = "" }; | 110 local response = { headers = { content_type = "text/plain" }; body = "" }; |
111 response.body = events.fire_event("http-error", { code = 500; private_message = err; response = response }); | 111 response.body = events.fire_event("http-error", { code = 500; private_message = err; response = response }); |
112 self.data.conn:write("HTTP/1.0 500 Internal Server Error\r\n\z\ | 112 self.data.conn:write("HTTP/1.0 500 Internal Server Error\r\n\z\ |
113 X-Content-Type-Options: nosniff\r\n\z\ | 113 X-Content-Type-Options: nosniff\r\n\z\ |
114 Content-Type: " .. response.header.content_type .. "\r\n\r\n"); | 114 Content-Type: " .. response.headers.content_type .. "\r\n\r\n"); |
115 self.data.conn:write(response.body); | 115 self.data.conn:write(response.body); |
116 self.data.conn:close(); | 116 self.data.conn:close(); |
117 end | 117 end |
118 | 118 |
119 local function noop() end | 119 local function noop() end |