Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7f82a231
Unverified
Commit
7f82a231
authored
Jan 29, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jan 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72689 from KevinKingKong/fix_aggregator_bug
Fix aggregator bug
parents
2d6834b5
3a52b978
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
handler_proxy.go
...src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy.go
+1
-0
handler_proxy_test.go
...8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go
+7
-0
No files found.
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy.go
View file @
7f82a231
...
...
@@ -142,6 +142,7 @@ func (r *proxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
newReq
:=
req
.
WithContext
(
context
.
Background
())
newReq
.
Header
=
utilnet
.
CloneHeader
(
req
.
Header
)
newReq
.
URL
=
location
newReq
.
Host
=
location
.
Host
if
handlingInfo
.
proxyRoundTripper
==
nil
{
proxyError
(
w
,
req
,
""
,
http
.
StatusNotFound
)
...
...
staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go
View file @
7f82a231
...
...
@@ -42,18 +42,21 @@ type targetHTTPHandler struct {
called
bool
headers
map
[
string
][]
string
path
string
host
string
}
func
(
d
*
targetHTTPHandler
)
Reset
()
{
d
.
path
=
""
d
.
called
=
false
d
.
headers
=
nil
d
.
host
=
""
}
func
(
d
*
targetHTTPHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
d
.
path
=
r
.
URL
.
Path
d
.
called
=
true
d
.
headers
=
r
.
Header
d
.
host
=
r
.
Host
w
.
WriteHeader
(
http
.
StatusOK
)
}
...
...
@@ -313,6 +316,10 @@ func TestProxyHandler(t *testing.T) {
t
.
Errorf
(
"%s: expected %v, got %v"
,
name
,
e
,
a
)
return
}
if
e
,
a
:=
targetServer
.
Listener
.
Addr
()
.
String
(),
target
.
host
;
tc
.
expectedCalled
&&
!
reflect
.
DeepEqual
(
e
,
a
)
{
t
.
Errorf
(
"%s: expected %v, got %v"
,
name
,
e
,
a
)
return
}
}()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment