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
ff70c08f
Unverified
Commit
ff70c08f
authored
Feb 08, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More zuul constant and javadoc updates
parent
506a9a44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
7 deletions
+23
-7
PreDecorationFilter.java
...k/cloud/netflix/zuul/filters/pre/PreDecorationFilter.java
+4
-0
ServletDetectionFilter.java
...loud/netflix/zuul/filters/pre/ServletDetectionFilter.java
+3
-3
FilterConstants.java
...k/cloud/netflix/zuul/filters/support/FilterConstants.java
+7
-1
RequestUtils.java
...springframework/cloud/netflix/zuul/util/RequestUtils.java
+9
-3
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre/PreDecorationFilter.java
View file @
ff70c08f
...
@@ -56,6 +56,10 @@ import static org.springframework.cloud.netflix.zuul.filters.support.FilterConst
...
@@ -56,6 +56,10 @@ import static org.springframework.cloud.netflix.zuul.filters.support.FilterConst
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
X_FORWARDED_PREFIX_HEADER
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
X_FORWARDED_PREFIX_HEADER
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
X_FORWARDED_PROTO_HEADER
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
X_FORWARDED_PROTO_HEADER
;
/**
* Pre {@link ZuulFilter} that determines where and how to route based on the supplied {@link RouteLocator}.
* Also sets various proxy related headers for downstream requests.
*/
public
class
PreDecorationFilter
extends
ZuulFilter
{
public
class
PreDecorationFilter
extends
ZuulFilter
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
PreDecorationFilter
.
class
);
private
static
final
Log
log
=
LogFactory
.
getLog
(
PreDecorationFilter
.
class
);
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre/ServletDetectionFilter.java
View file @
ff70c08f
...
@@ -18,7 +18,6 @@ package org.springframework.cloud.netflix.zuul.filters.pre;
...
@@ -18,7 +18,6 @@ package org.springframework.cloud.netflix.zuul.filters.pre;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.cloud.netflix.zuul.util.RequestUtils
;
import
org.springframework.web.servlet.DispatcherServlet
;
import
org.springframework.web.servlet.DispatcherServlet
;
import
com.netflix.zuul.ZuulFilter
;
import
com.netflix.zuul.ZuulFilter
;
...
@@ -26,6 +25,7 @@ import com.netflix.zuul.context.RequestContext;
...
@@ -26,6 +25,7 @@ import com.netflix.zuul.context.RequestContext;
import
com.netflix.zuul.http.HttpServletRequestWrapper
;
import
com.netflix.zuul.http.HttpServletRequestWrapper
;
import
com.netflix.zuul.http.ZuulServlet
;
import
com.netflix.zuul.http.ZuulServlet
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
IS_DISPATCHER_SERVLET_REQUEST_KEY
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
PRE_TYPE
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
PRE_TYPE
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
SERVLET_DETECTION_FILTER_ORDER
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
SERVLET_DETECTION_FILTER_ORDER
;
...
@@ -67,9 +67,9 @@ public class ServletDetectionFilter extends ZuulFilter {
...
@@ -67,9 +67,9 @@ public class ServletDetectionFilter extends ZuulFilter {
HttpServletRequest
request
=
ctx
.
getRequest
();
HttpServletRequest
request
=
ctx
.
getRequest
();
if
(!(
request
instanceof
HttpServletRequestWrapper
)
if
(!(
request
instanceof
HttpServletRequestWrapper
)
&&
isDispatcherServletRequest
(
request
))
{
&&
isDispatcherServletRequest
(
request
))
{
ctx
.
set
(
RequestUtils
.
IS_DISPATCHERSERVLETREQUEST
,
true
);
ctx
.
set
(
IS_DISPATCHER_SERVLET_REQUEST_KEY
,
true
);
}
else
{
}
else
{
ctx
.
set
(
RequestUtils
.
IS_DISPATCHERSERVLETREQUEST
,
false
);
ctx
.
set
(
IS_DISPATCHER_SERVLET_REQUEST_KEY
,
false
);
}
}
return
null
;
return
null
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/support/FilterConstants.java
View file @
ff70c08f
...
@@ -17,11 +17,12 @@
...
@@ -17,11 +17,12 @@
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
;
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
;
import
com.netflix.zuul.ZuulFilter
;
import
org.springframework.cloud.netflix.zuul.filters.pre.DebugFilter
;
import
org.springframework.cloud.netflix.zuul.filters.pre.DebugFilter
;
import
org.springframework.cloud.netflix.zuul.filters.pre.Servlet30WrapperFilter
;
import
org.springframework.cloud.netflix.zuul.filters.pre.Servlet30WrapperFilter
;
import
org.springframework.cloud.netflix.zuul.filters.route.SendForwardFilter
;
import
org.springframework.cloud.netflix.zuul.filters.route.SendForwardFilter
;
import
com.netflix.zuul.ZuulFilter
;
/**
/**
* @author Spencer Gibb
* @author Spencer Gibb
*/
*/
...
@@ -30,6 +31,11 @@ public interface FilterConstants {
...
@@ -30,6 +31,11 @@ public interface FilterConstants {
// KEY constants -----------------------------------
// KEY constants -----------------------------------
/**
/**
* Zuul {@link com.netflix.zuul.context.RequestContext} key for use in {@link org.springframework.cloud.netflix.zuul.filters.pre.ServletDetectionFilter}
*/
String
IS_DISPATCHER_SERVLET_REQUEST_KEY
=
"isDispatcherServletRequest"
;
/**
* Zuul {@link com.netflix.zuul.context.RequestContext} key for use in {@link org.springframework.cloud.netflix.zuul.filters.route.SendForwardFilter}
* Zuul {@link com.netflix.zuul.context.RequestContext} key for use in {@link org.springframework.cloud.netflix.zuul.filters.route.SendForwardFilter}
*/
*/
String
FORWARD_TO_KEY
=
"forward.to"
;
String
FORWARD_TO_KEY
=
"forward.to"
;
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/util/RequestUtils.java
View file @
ff70c08f
...
@@ -2,12 +2,18 @@ package org.springframework.cloud.netflix.zuul.util;
...
@@ -2,12 +2,18 @@ package org.springframework.cloud.netflix.zuul.util;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.context.RequestContext
;
import
static
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
support
.
FilterConstants
.
IS_DISPATCHER_SERVLET_REQUEST_KEY
;
public
class
RequestUtils
{
public
class
RequestUtils
{
public
static
final
String
IS_DISPATCHERSERVLETREQUEST
=
"isDispatcherServletRequest"
;
/**
* @deprecated use {@link org.springframework.cloud.netflix.zuul.filters.support.FilterConstants#IS_DISPATCHER_SERVLET_REQUEST_KEY}
*/
@Deprecated
public
static
final
String
IS_DISPATCHERSERVLETREQUEST
=
IS_DISPATCHER_SERVLET_REQUEST_KEY
;
public
static
boolean
isDispatcherServletRequest
()
{
public
static
boolean
isDispatcherServletRequest
()
{
return
RequestContext
.
getCurrentContext
().
getBoolean
(
IS_DISPATCHER
SERVLETREQUEST
);
return
RequestContext
.
getCurrentContext
().
getBoolean
(
IS_DISPATCHER
_SERVLET_REQUEST_KEY
);
}
}
public
static
boolean
isZuulServletRequest
()
{
public
static
boolean
isZuulServletRequest
()
{
...
...
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