]> Cypherpunks repositories - gostls13.git/commit
net/http: document that Handlers shouldn't mutate Request
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 5 Apr 2016 15:59:55 +0000 (15:59 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 6 Apr 2016 02:40:49 +0000 (02:40 +0000)
commite0307c25bebd694b98ae538065cda0681ef9ecf1
tree7bab1af7d69708096ec62294861a1215bf238113
parent8556c76f88a6e80aafb535802be71cc79bd22c75
net/http: document that Handlers shouldn't mutate Request

Also, don't read from the Request.Headers in the http Server code once
ServeHTTP has started. This is partially redundant with documenting
that handlers shouldn't mutate request, but: the space is free due to
bool packing, it's faster to do the checks once instead of N times in
writeChunk, and it's a little nicer to code which previously didn't
play by the unwritten rules. But I'm not going to fix all the cases.

Fixes #14940

Change-Id: I612a8826b41c8682b59515081c590c512ee6949e
Reviewed-on: https://go-review.googlesource.com/21530
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/net/http/server.go