Skip to content

Commit baa2d89

Browse files
committed
Prohibit access to main page if there is no template is provided
1 parent adbdf5d commit baa2d89

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func reverseProxy(targetURL string, w http.ResponseWriter, r *http.Request) {
135135
r.Header.Set("X-Forwarded-For", r.RemoteAddr)
136136
r.Host = url.Host
137137
if Config.Verbose > 0 {
138-
log.Printf("### proxy request: %+v\n", r)
138+
log.Printf("proxy request: %+v\n", r)
139139
}
140140

141141
// use custom modify response function to setup response headers
@@ -245,9 +245,8 @@ func redirect(w http.ResponseWriter, r *http.Request) {
245245
return
246246
}
247247

248-
msg := fmt.Sprintf("Hello %s", r.URL.Path)
249-
data := []byte(msg)
250-
w.Write(data)
248+
// prohibit access to main page
249+
w.WriteHeader(http.StatusNotFound)
251250
return
252251
}
253252
return

0 commit comments

Comments
 (0)