public class HttpAllowOriginHeaderFilter extends Object implements javax.servlet.Filter
HttpServletRequest
and HttpServletResponse
.
The response header gets the Access-Control-Allow-Origin
value set to *
. If the request method is
OPTIONS
, the response header also gets Access-Control-Allow-Methods
set to GET
and
Access-Control-Allow-Headers
set to accept, authorization
. Modified requests and responses are then
rejected by the filter.
Constructor and Description |
---|
HttpAllowOriginHeaderFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
init(javax.servlet.FilterConfig filterConfig) |
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
Copyright © 2018 SAP SE. All rights reserved.