Browse Source

Redirect hotlink instead of 403. Fixes #69

pull/73/head
andreimarcu 9 years ago
parent
commit
9cf55ac687
  1. 2
      fileserve.go

2
fileserve.go

@ -28,7 +28,7 @@ func fileServeHandler(c web.C, w http.ResponseWriter, r *http.Request) {
u, _ := url.Parse(referer) u, _ := url.Parse(referer)
p, _ := url.Parse(Config.siteURL) p, _ := url.Parse(Config.siteURL)
if referer != "" && !sameOrigin(u, p) { if referer != "" && !sameOrigin(u, p) {
w.WriteHeader(403)
http.Redirect(w, r, Config.sitePath+fileName, 303)
return return
} }
} }

Loading…
Cancel
Save