Comparison

plugins/mod_websocket.lua @ 7914:a6eb3b6bf903

mod_websocket: Set connections starttls method to false to prevent mod_tls from offering starttls (fixes #837)
author Kim Alvefur <zash@zash.se>
date Sat, 25 Feb 2017 02:15:15 +0100
parent 7764:d6b96e42e8e6
child 7937:5b03a8003659
comparison
equal deleted inserted replaced
7913:64daa21450f9 7914:a6eb3b6bf903
133 return data; 133 return data;
134 end 134 end
135 function handle_request(event) 135 function handle_request(event)
136 local request, response = event.request, event.response; 136 local request, response = event.request, event.response;
137 local conn = response.conn; 137 local conn = response.conn;
138
139 conn.starttls = false; -- Prevent mod_tls from believing starttls can be done
138 140
139 if not request.headers.sec_websocket_key then 141 if not request.headers.sec_websocket_key then
140 response.headers.content_type = "text/html"; 142 response.headers.content_type = "text/html";
141 return [[<!DOCTYPE html><html><head><title>Websocket</title></head><body> 143 return [[<!DOCTYPE html><html><head><title>Websocket</title></head><body>
142 <p>It works! Now point your WebSocket client to this URL to connect to Prosody.</p> 144 <p>It works! Now point your WebSocket client to this URL to connect to Prosody.</p>