404 instead of 403
This commit is contained in:
6
main.go
6
main.go
@@ -97,7 +97,7 @@ func (sl *ShortLinks) serveRootWithPath(w http.ResponseWriter, r *http.Request,
|
|||||||
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
||||||
|
|
||||||
if !sl.isWritable(r.Host) {
|
if !sl.isWritable(r.Host) {
|
||||||
sendError(w, http.StatusForbidden, "not writable")
|
sendError(w, http.StatusNotFound, "not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ func (sl *ShortLinks) serveSet(w http.ResponseWriter, r *http.Request) {
|
|||||||
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
||||||
|
|
||||||
if !sl.isWritable(r.Host) {
|
if !sl.isWritable(r.Host) {
|
||||||
sendError(w, http.StatusForbidden, "not writable")
|
sendError(w, http.StatusNotFound, "not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ func (sl *ShortLinks) serveSuggest(w http.ResponseWriter, r *http.Request) {
|
|||||||
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, sl.getDomain(r.Host), r.URL)
|
||||||
|
|
||||||
if !sl.isWritable(r.Host) {
|
if !sl.isWritable(r.Host) {
|
||||||
sendError(w, http.StatusForbidden, "not writable")
|
sendError(w, http.StatusNotFound, "not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user