Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1072)

Delta Between Two Patch Sets: src/pkg/http/reverseproxy_test.go

Issue 4620049: code review 4620049: http: make Headers be source of truth (Closed)
Left Patch Set: diff -r bd35e21c471e https://go.googlecode.com/hg Created 13 years, 9 months ago
Right Patch Set: diff -r f5d2325ee229 https://go.googlecode.com/hg Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/http/reverseproxy.go ('k') | src/pkg/http/server.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Reverse proxy tests. 5 // Reverse proxy tests.
6 6
7 package http_test 7 package http_test
8 8
9 import ( 9 import (
10 . "http" 10 . "http"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 if g, e := res.StatusCode, backendStatus; g != e { 46 if g, e := res.StatusCode, backendStatus; g != e {
47 t.Errorf("got res.StatusCode %d; expected %d", g, e) 47 t.Errorf("got res.StatusCode %d; expected %d", g, e)
48 } 48 }
49 if g, e := res.Header.Get("X-Foo"), "bar"; g != e { 49 if g, e := res.Header.Get("X-Foo"), "bar"; g != e {
50 t.Errorf("got X-Foo %q; expected %q", g, e) 50 t.Errorf("got X-Foo %q; expected %q", g, e)
51 } 51 }
52 if g, e := len(res.Header["Set-Cookie"]), 1; g != e { 52 if g, e := len(res.Header["Set-Cookie"]), 1; g != e {
53 t.Fatalf("got %d SetCookies, want %d", g, e) 53 t.Fatalf("got %d SetCookies, want %d", g, e)
54 } 54 }
55 » if cookie := res.SetCookies()[0]; cookie.Name != "flavor" { 55 » if cookie := res.Cookies()[0]; cookie.Name != "flavor" {
56 t.Errorf("unexpected cookie %q", cookie.Name) 56 t.Errorf("unexpected cookie %q", cookie.Name)
57 } 57 }
58 bodyBytes, _ := ioutil.ReadAll(res.Body) 58 bodyBytes, _ := ioutil.ReadAll(res.Body)
59 if g, e := string(bodyBytes), backendResponse; g != e { 59 if g, e := string(bodyBytes), backendResponse; g != e {
60 t.Errorf("got body %q; expected %q", g, e) 60 t.Errorf("got body %q; expected %q", g, e)
61 } 61 }
62 } 62 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b