1. 29 Nov, 2017 5 commits
  2. 28 Nov, 2017 9 commits
  3. 27 Nov, 2017 8 commits
    • Brad Fitzpatrick's avatar
      net/http: panic on invalid WriteHeader status code · 18ae4c83
      Brad Fitzpatrick authored
      Panic if an http Handler does:
      
          rw.WriteHeader(0)
      
      ... or other invalid values. (for a forgiving range of valid)
      
      I previously made it kinda work in https://golang.org/cl/19130 but
      there's no good way to fake it in HTTP/2, and we want HTTP/1 and
      HTTP/2 behavior to be the same, regardless of what programs do.
      Currently HTTP/2 omitted the :status header altogether, which was a
      protocol violation. In fixing that, I found CL 19130 added a test
      about bogus WriteHeader values with the comment:
      
        // This might change at some point, but not yet in Go 1.6.
      
      This now changes. Time to be strict.
      
      Updates golang/go#228800
      
      Change-Id: I20eb6c0e514a31f4bba305ac4c24266f39b95fd5
      Reviewed-on: https://go-review.googlesource.com/80077Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
      18ae4c83
    • Tom Bergan's avatar
      net/textproto: reject all headers with a leading space · 1c69384d
      Tom Bergan authored
      Previously, golang.org/cl/75350 updated ReadMIMEHeader to ignore the
      first header line when it begins with a leading space, as in the
      following example:
      
      GET / HTTP/1.1
        Host: foo.com
      Accept-Encoding: gzip
      
      However, golang.org/cl/75350 changed ReadMIMEHeader's behavior for the
      following example: before the CL it returned an error, but after the
      CL it ignored the first line.
      
      GET / HTTP/1.1
        Host foo.com
      Accept-Encoding: gzip
      
      This change updates ReadMIMEHeader to always fail when the first header
      line starts with a space. During the discussion for golang.org/cl/75350,
      we realized we had three competing needs:
      
      1. HTTP clients should accept malformed response headers when possible
         (ignoring the malformed lines).
      
      2. HTTP servers should reject all malformed request headers.
      
      3. The net/textproto package is used by multiple protocols (most notably,
         HTTP and SMTP) which have slightly different parsing semantics. This
         complicates changes to net/textproto.
      
      We weren't sure how to best fix net/textproto without an API change, but
      it is too late for API changes in Go 1.10. We decided to ignore initial
      lines that begin with spaces, thinking that would have the least impact on
      existing users -- malformed headers would continue to parse, but the
      initial lines would be ignored. Instead, golang.org/cl/75350 actually
      changed ReadMIMEHeader to succeed in cases where it previously failed
      (as in the above example).
      
      Reconsidering the above two examples, there does not seem to be a good
      argument to silently ignore ` Host: foo.com` but fail on ` Host foo.com`.
      Hence, this change fails for *all* headers where the initial line begins
      with a space.
      
      Updates #22464
      
      Change-Id: I68d3d190489c350b0bc1549735bf6593fe11a94c
      Reviewed-on: https://go-review.googlesource.com/80055
      Run-TryBot: Tom Bergan <tombergan@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1c69384d
    • rajender's avatar
      encoding/json: remove the word "text" in "JSON text" from package docs. · 671cf92c
      rajender authored
      It was added in CL 79995. It is unnecessarily confusing.
      
      Change-Id: Ib8ff35b9f71b54ff99d2d6e0534c7128e1f4345a
      Reviewed-on: https://go-review.googlesource.com/80035Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      671cf92c
    • rajender's avatar
      encoding/json: update RFC number · 0d264746
      rajender authored
      Existing docs mention obsolete RFC 4627. Update it with current one,
      https://tools.ietf.org/html/rfc7159.
      
      Current implementation already adhere to RFC 7159.
      
      Fixes #22888
      
      Change-Id: I705ec1313f6f655b3bc41d2f847b30e479bf9b15
      Reviewed-on: https://go-review.googlesource.com/79995Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      0d264746
    • Keith Randall's avatar
      cmd/compile: remove unused code · 5419ed3a
      Keith Randall authored
      Found a few functions in cmd/compile that aren't used.
      
      Change-Id: I53957dae6f1a645feb8b95383f0f050964b4f7d4
      Reviewed-on: https://go-review.googlesource.com/79975
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      5419ed3a
    • Robert Griesemer's avatar
      go/types: add debugging code to detect use of incomplete interfaces · 3c7e491b
      Robert Griesemer authored
      The comment for phase 2 of checker.interfaceType (typexpr.go:517)
      requires that embedded interfaces be complete for correctness of
      the algorithm.
      
      Yet, the very next comment (typexpr.go:530) states that underlying
      embedded interfaces may in fact be incomplete.
      
      This is in fact the case and the underlying bug in issue #18395.
      
      This change makes sure that new interface types are marked complete
      when finished (per the implicit definition in Interface.Complete,
      type.go:302). It also adds a check, enabled in debug mode only, to
      detect the use of incomplete embedded interfaces during construction
      of a new interface. In debug mode, this check fails for the testcase
      in the issue (and several others).
      
      This change has no noticeable impact with debug mode disabled.
      
      For #18395.
      
      Change-Id: Ibb81e47257651282fb3755a80a36ab5d392e636d
      Reviewed-on: https://go-review.googlesource.com/78955Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      3c7e491b
    • Andrew Bonventre's avatar
      doc: update URL of the go1.4 source snapshot to use dl.google.com · 4aac23cc
      Andrew Bonventre authored
      Updates golang/go#20672
      
      Change-Id: I88a1d8693ef9d1e4758719603ce1f3c3f6b920bc
      Reviewed-on: https://go-review.googlesource.com/79936Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      4aac23cc
    • Brian Kessler's avatar
      math/cmplx: use signed zero to correct branch cuts · 802a8f88
      Brian Kessler authored
      Branch cuts for the elementary complex functions along real or imaginary axes
      should be resolved in floating point calculations by one-sided continuity with
      signed zero as described in:
      
      "Branch Cuts for Complex Elementary Functions or Much Ado About Nothing's Sign Bit"
      W. Kahan
      
      Available at: https://people.freebsd.org/~das/kahan86branch.pdf
      
      And as described in the C99 standard which is claimed as the original cephes source.
      
      Sqrt did not return the correct branch when imag(x) == 0. The branch is now
      determined by sign(imag(x)).  This incorrect branch choice was affecting the behavior
      of the Trigonometric/Hyperbolic functions that use Sqrt in intermediate calculations.
      
      Asin, Asinh and Atan had spurious domain checks, whereas the functions should be valid
      over the whole complex plane with appropriate branch cuts.
      
      Fixes #6888
      
      Change-Id: I9b1278af54f54bfb4208276ae345bbd3ddf3ec83
      Reviewed-on: https://go-review.googlesource.com/46492
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      802a8f88
  4. 26 Nov, 2017 2 commits
  5. 25 Nov, 2017 3 commits
  6. 24 Nov, 2017 2 commits
    • Austin Clements's avatar
      runtime: fix final stack split in exitsyscall · be589f8d
      Austin Clements authored
      exitsyscall should be recursively nosplit, but we don't have a way to
      annotate that right now (see #21314). There's exactly one remaining
      place where this is violated right now: exitsyscall -> casgstatus ->
      print. The other prints in casgstatus are wrapped in systemstack
      calls. This fixes the remaining print.
      
      Updates #21431 (in theory could fix it, but that would just indicate
      that we have a different G status-related crash and we've *never* seen
      that failure on the dashboard.)
      
      Change-Id: I9a5e8d942adce4a5c78cfc6b306ea5bda90dbd33
      Reviewed-on: https://go-review.googlesource.com/79815
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      be589f8d
    • Emmanuel Odeke's avatar
      runtime: tweak doc for Goexit · 2e1f0713
      Emmanuel Odeke authored
      Use singular form of panic and remove the unnecessary
      'however', when comparing Goexit's behavior to 'a panic'
      as well as what happens for deferred recovers with Goexit.
      
      Change-Id: I3116df3336fa135198f6a39cf93dbb88a0e2f46e
      Reviewed-on: https://go-review.googlesource.com/79755Reviewed-by: 's avatarRob Pike <r@golang.org>
      2e1f0713
  7. 23 Nov, 2017 8 commits
  8. 22 Nov, 2017 3 commits