forked from solderpunk/molly-brown
Check that request hostname matches configured hostname.
This commit is contained in:
parent
b3a87c3739
commit
23a6284cc4
|
@ -57,6 +57,13 @@ func handleGeminiRequest(conn net.Conn, config Config, logEntries chan LogEntry)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reject requests for content from other servers
|
||||||
|
if URL.Host != config.Hostname {
|
||||||
|
conn.Write([]byte("53 No proxying to other hosts!\r\n"))
|
||||||
|
log.Status = 53
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Fail if there are dots in the path
|
// Fail if there are dots in the path
|
||||||
if strings.Contains(URL.Path, "..") {
|
if strings.Contains(URL.Path, "..") {
|
||||||
conn.Write([]byte("50 Your directory traversal technique has been defeated!\r\n"))
|
conn.Write([]byte("50 Your directory traversal technique has been defeated!\r\n"))
|
||||||
|
|
Loading…
Reference in New Issue