Commit cd6f1877 authored by Daniel Martí's avatar Daniel Martí Committed by Brad Fitzpatrick

net/http: remove unused ResponseWriter params

Found by github.com/mvdan/unparam.

Change-Id: I66f5a191cf9c9a11a7c3c4d7ee0a02e2c185f019
Reviewed-on: https://go-review.googlesource.com/37841Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent d10b50dc
...@@ -373,7 +373,7 @@ func checkIfMatch(w ResponseWriter, r *Request) condResult { ...@@ -373,7 +373,7 @@ func checkIfMatch(w ResponseWriter, r *Request) condResult {
return condFalse return condFalse
} }
func checkIfUnmodifiedSince(w ResponseWriter, r *Request, modtime time.Time) condResult { func checkIfUnmodifiedSince(r *Request, modtime time.Time) condResult {
ius := r.Header.Get("If-Unmodified-Since") ius := r.Header.Get("If-Unmodified-Since")
if ius == "" || isZeroTime(modtime) { if ius == "" || isZeroTime(modtime) {
return condNone return condNone
...@@ -418,7 +418,7 @@ func checkIfNoneMatch(w ResponseWriter, r *Request) condResult { ...@@ -418,7 +418,7 @@ func checkIfNoneMatch(w ResponseWriter, r *Request) condResult {
return condTrue return condTrue
} }
func checkIfModifiedSince(w ResponseWriter, r *Request, modtime time.Time) condResult { func checkIfModifiedSince(r *Request, modtime time.Time) condResult {
if r.Method != "GET" && r.Method != "HEAD" { if r.Method != "GET" && r.Method != "HEAD" {
return condNone return condNone
} }
...@@ -503,7 +503,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b ...@@ -503,7 +503,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b
// This function carefully follows RFC 7232 section 6. // This function carefully follows RFC 7232 section 6.
ch := checkIfMatch(w, r) ch := checkIfMatch(w, r)
if ch == condNone { if ch == condNone {
ch = checkIfUnmodifiedSince(w, r, modtime) ch = checkIfUnmodifiedSince(r, modtime)
} }
if ch == condFalse { if ch == condFalse {
w.WriteHeader(StatusPreconditionFailed) w.WriteHeader(StatusPreconditionFailed)
...@@ -519,7 +519,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b ...@@ -519,7 +519,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b
return true, "" return true, ""
} }
case condNone: case condNone:
if checkIfModifiedSince(w, r, modtime) == condFalse { if checkIfModifiedSince(r, modtime) == condFalse {
writeNotModified(w) writeNotModified(w)
return true, "" return true, ""
} }
...@@ -604,7 +604,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec ...@@ -604,7 +604,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec
// Still a directory? (we didn't find an index.html file) // Still a directory? (we didn't find an index.html file)
if d.IsDir() { if d.IsDir() {
if checkIfModifiedSince(w, r, d.ModTime()) == condFalse { if checkIfModifiedSince(r, d.ModTime()) == condFalse {
writeNotModified(w) writeNotModified(w)
return return
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment