Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
da6da6d7
Commit
da6da6d7
authored
Jan 06, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-organise headers in the /trace of Zuul requests
Now they match better what the vanilla /trace data does in terms of object and field names.
parent
24288691
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
ProxyRequestHelper.java
...mework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
+15
-14
PreDecorationFilter.java
...k/cloud/netflix/zuul/filters/pre/PreDecorationFilter.java
+1
-1
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
View file @
da6da6d7
...
...
@@ -182,8 +182,21 @@ public class ProxyRequestHelper {
if
(
traces
!=
null
)
{
RequestContext
context
=
RequestContext
.
getCurrentContext
();
StringBuilder
query
=
new
StringBuilder
();
for
(
String
param
:
params
.
keySet
())
{
for
(
String
value
:
params
.
get
(
param
))
{
query
.
append
(
param
);
query
.
append
(
"="
);
query
.
append
(
value
);
query
.
append
(
"&"
);
}
}
info
.
put
(
"method"
,
verb
);
info
.
put
(
"path"
,
uri
);
info
.
put
(
"query"
,
query
.
toString
());
info
.
put
(
"remote"
,
true
);
info
.
put
(
"serviceId"
,
context
.
get
(
"serviceId"
));
info
.
put
(
"proxy"
,
context
.
get
(
"proxy"
));
Map
<
String
,
Object
>
trace
=
new
LinkedHashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
input
=
new
LinkedHashMap
<
String
,
Object
>();
trace
.
put
(
"request"
,
input
);
...
...
@@ -196,19 +209,7 @@ public class ProxyRequestHelper {
}
input
.
put
(
entry
.
getKey
(),
value
);
}
StringBuilder
query
=
new
StringBuilder
();
for
(
String
param
:
params
.
keySet
())
{
for
(
String
value
:
params
.
get
(
param
))
{
query
.
append
(
param
);
query
.
append
(
"="
);
query
.
append
(
value
);
query
.
append
(
"&"
);
}
}
info
.
put
(
"method"
,
verb
);
info
.
put
(
"uri"
,
uri
);
info
.
put
(
"query"
,
query
.
toString
());
RequestContext
ctx
=
RequestContext
.
getCurrentContext
();
if
(!
ctx
.
isChunkedRequestBody
())
{
if
(
requestEntity
!=
null
)
{
...
...
@@ -228,7 +229,6 @@ public class ProxyRequestHelper {
Map
<
String
,
Object
>
trace
=
(
Map
<
String
,
Object
>)
info
.
get
(
"headers"
);
Map
<
String
,
Object
>
output
=
new
LinkedHashMap
<
String
,
Object
>();
trace
.
put
(
"response"
,
output
);
info
.
put
(
"status"
,
""
+
status
);
for
(
Entry
<
String
,
List
<
String
>>
key
:
headers
.
entrySet
())
{
Collection
<
String
>
collection
=
key
.
getValue
();
Object
value
=
collection
;
...
...
@@ -237,6 +237,7 @@ public class ProxyRequestHelper {
}
output
.
put
(
key
.
getKey
(),
value
);
}
output
.
put
(
"status"
,
""
+
status
);
}
}
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre/PreDecorationFilter.java
View file @
da6da6d7
...
...
@@ -55,7 +55,7 @@ public class PreDecorationFilter extends ZuulFilter {
String
location
=
route
.
getLocation
();
if
(
location
!=
null
)
{
ctx
.
put
(
"requestURI"
,
route
.
getPath
());
ctx
.
put
(
"proxy"
,
route
.
getId
());
...
...
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