Software /
code /
prosody
Comparison
net/http/server.lua @ 9337:5d6b252bc36f
net.http.server: Fix default host logic
This was used to construct the event name previously
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Sep 2018 21:33:41 +0200 |
parent | 9335:2dc7490899ae |
child | 9338:9beb767295d4 |
comparison
equal
deleted
inserted
replaced
9336:9e8d7d461c7d | 9337:5d6b252bc36f |
---|---|
217 local err_code, err; | 217 local err_code, err; |
218 if not request.path then | 218 if not request.path then |
219 err_code, err = 400, "Invalid path"; | 219 err_code, err = 400, "Invalid path"; |
220 elseif not hosts[host] then | 220 elseif not hosts[host] then |
221 if hosts[default_host] then | 221 if hosts[default_host] then |
222 host = default_host; | 222 request.host = default_host; |
223 elseif host then | 223 elseif host then |
224 err_code, err = 404, "Unknown host: "..host; | 224 err_code, err = 404, "Unknown host: "..host; |
225 else | 225 else |
226 err_code, err = 400, "Missing or invalid 'Host' header"; | 226 err_code, err = 400, "Missing or invalid 'Host' header"; |
227 end | 227 end |