mirror of
https://tildegit.org/solderpunk/molly-brown.git
synced 2025-04-13 09:29:46 +00:00
Check that request port matches configured server port. Should fix #9.
This commit is contained in:
parent
b0fd07f58a
commit
4c27911e8f
1 changed files with 2 additions and 3 deletions
|
@ -60,9 +60,8 @@ func handleGeminiRequest(conn net.Conn, config Config, accessLogEntries chan Log
|
|||
}
|
||||
|
||||
// Reject requests for content from other servers
|
||||
requestHostname := strings.Split(URL.Host, ":")[0] // Shave off port
|
||||
if requestHostname != config.Hostname {
|
||||
conn.Write([]byte("53 No proxying to other hosts!\r\n"))
|
||||
if URL.Hostname() != config.Hostname || (URL.Port() != "" && URL.Port() != config.Port) {
|
||||
conn.Write([]byte("53 No proxying to other hosts or ports!\r\n"))
|
||||
log.Status = 53
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue