1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-28 05:36:12 +02:00

Assume a default scheme of gemini://

This commit is contained in:
Adnan Maolood 2020-10-21 15:47:32 -04:00
parent 9daf84a121
commit 376c602748

View File

@ -232,7 +232,10 @@ func (s *Server) respond(conn net.Conn) {
// Note that we return an error status if User is specified in the URL
w.WriteHeader(StatusBadRequest, "Bad request")
} else {
// Gather information about the request
// If no scheme is specified, assume a default scheme of gemini://
if url.Scheme == "" {
url.Scheme = "gemini"
}
req := &Request{
URL: url,
RemoteAddr: conn.RemoteAddr(),