aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-18 00:06:34 -0500
committerAdnan Maolood <[email protected]>2021-02-18 00:06:34 -0500
commita3a995df3595fb58535078d2228d418a2ffc3ea9 (patch)
tree5198fd4636bc776f267b7c4b60d23a1cf9665f08
parentresponse: Ensure that only one header is written (diff)
downloadgo-gemini-a3a995df3595fb58535078d2228d418a2ffc3ea9.tar.xz
go-gemini-a3a995df3595fb58535078d2228d418a2ffc3ea9.zip
response: Rename statusCode to status
-rw-r--r--response.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/response.go b/response.go
index 3932ae4..b02b507 100644
--- a/response.go
+++ b/response.go
@@ -167,7 +167,7 @@ type ResponseWriter interface {
// The provided code must be a valid Gemini status code.
// The provided meta must not be longer than 1024 bytes.
// Only one header may be written.
- WriteHeader(statusCode int, meta string)
+ WriteHeader(status int, meta string)
}
// The Flusher interface is implemented by ResponseWriters that allow a
@@ -218,16 +218,16 @@ func (w *responseWriter) Write(b []byte) (int, error) {
return w.b.Write(b)
}
-func (w *responseWriter) WriteHeader(statusCode int, meta string) {
+func (w *responseWriter) WriteHeader(status int, meta string) {
if w.wroteHeader {
return
}
- if StatusClass(statusCode) == StatusSuccess {
+ if StatusClass(status) == StatusSuccess {
w.bodyAllowed = true
}
- w.b.WriteString(strconv.Itoa(statusCode))
+ w.b.WriteString(strconv.Itoa(status))
w.b.WriteByte(' ')
w.b.WriteString(meta)
w.b.Write(crlf)