Respond with status 53 if an unknown hostname is requested
This commit is contained in:
parent
cf91752b5b
commit
d1905e688c
|
@ -57,6 +57,10 @@ v0.6.1:
|
|||
* Static: Fixed unquoting URL paths when looking up files.
|
||||
* Added example of printing Gemini meta line in CGI documentation.
|
||||
|
||||
v0.6.2:
|
||||
|
||||
* Respond with status 53 if an unknown hostname is requested. This helps reveal configuration errors where the correct hostnames are not specified.
|
||||
|
||||
### v0.5
|
||||
|
||||
* Added `processes` to the `[server]` section to configure how many request handler processes are started.
|
||||
|
|
|
@ -387,6 +387,9 @@ def handle_gemini_or_titan_request(request_data):
|
|||
if stream.get_servername().decode() != hostname:
|
||||
report_error(stream, 53, "Proxy request refused")
|
||||
return
|
||||
if stream.get_servername().decode() not in worker.cfg.hostnames():
|
||||
report_error(stream, 53, f"Proxy request refused ({stream.get_servername().decode()})")
|
||||
return
|
||||
|
||||
try:
|
||||
status, meta, body, from_cache = worker.context.call_entrypoint(Request(
|
||||
|
|
Loading…
Reference in New Issue