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

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

Issue 6875060: code review 6875060: net/http: fix bug parsing http_proxy lacking a protocol (Closed)
Left Patch Set: Created 11 years, 3 months ago
Right Patch Set: diff -r f7c125983d99 https://go.googlecode.com/hg/ Created 11 years, 3 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/http/transport.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 // Tests for transport.go 5 // Tests for transport.go
6 6
7 package http_test 7 package http_test
8 8
9 import ( 9 import (
10 "bytes" 10 "bytes"
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 t.Errorf("got response %q, want %q", body, e) 1061 t.Errorf("got response %q, want %q", body, e)
1062 } 1062 }
1063 } 1063 }
1064 1064
1065 var proxyFromEnvTests = []struct { 1065 var proxyFromEnvTests = []struct {
1066 env string 1066 env string
1067 wanturl string 1067 wanturl string
1068 wanterr error 1068 wanterr error
1069 }{ 1069 }{
1070 {"127.0.0.1:8080", "http://127.0.0.1:8080", nil}, 1070 {"127.0.0.1:8080", "http://127.0.0.1:8080", nil},
1071 {"cache.corp.example.com:1234", "http://cache.corp.example.com:1234", ni l},
1072 {"cache.corp.example.com", "http://cache.corp.example.com", nil},
1073 {"https://cache.corp.example.com", "https://cache.corp.example.com", nil },
1071 {"http://127.0.0.1:8080", "http://127.0.0.1:8080", nil}, 1074 {"http://127.0.0.1:8080", "http://127.0.0.1:8080", nil},
1072 {"https://127.0.0.1:8080", "https://127.0.0.1:8080", nil}, 1075 {"https://127.0.0.1:8080", "https://127.0.0.1:8080", nil},
1073 {"", "<nil>", nil}, 1076 {"", "<nil>", nil},
1074 } 1077 }
1075 1078
1076 func TestProxyFromEnvironment(t *testing.T) { 1079 func TestProxyFromEnvironment(t *testing.T) {
1077 os.Setenv("HTTP_PROXY", "") 1080 os.Setenv("HTTP_PROXY", "")
1078 os.Setenv("http_proxy", "") 1081 os.Setenv("http_proxy", "")
1079 os.Setenv("NO_PROXY", "") 1082 os.Setenv("NO_PROXY", "")
1080 os.Setenv("no_proxy", "") 1083 os.Setenv("no_proxy", "")
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 1123 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00,
1121 0x17, 0x00, 0xe8, 0xff, 0x42, 0x12, 0x46, 0x16, 1124 0x17, 0x00, 0xe8, 0xff, 0x42, 0x12, 0x46, 0x16,
1122 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, 1125 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08,
1123 0x00, 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 1126 0x00, 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa,
1124 0x00, 0x00, 0x00, 0x42, 0x12, 0x46, 0x16, 0x06, 1127 0x00, 0x00, 0x00, 0x42, 0x12, 0x46, 0x16, 0x06,
1125 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, 0x00, 1128 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, 0x00,
1126 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, 1129 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00,
1127 0x00, 0x00, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, 1130 0x00, 0x00, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00,
1128 0x00, 0x00, 1131 0x00, 0x00,
1129 } 1132 }
LEFTRIGHT

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