Skip to content

Commit

Permalink
ForwardingFilter now allows the slash to be omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed May 13, 2020
1 parent a8513c0 commit dd3960d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
String requestURI = request.getRequestURI();

String contextPath = ((HttpServletRequest) req).getContextPath();
String prefix = contextPath + "/ws/fhir2/";
String prefix = contextPath + "/ws/fhir2";
if (requestURI.startsWith(prefix)) {
String newURI = requestURI.replace(prefix, "/ms/fhir2Servlet/");
String newURI = requestURI.replace(prefix, "/ms/fhir2Servlet");
req.getRequestDispatcher(newURI).forward(req, res);
} else {
chain.doFilter(req, res);
Expand Down
3 changes: 3 additions & 0 deletions omod/src/main/resources/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
</filter>
<filter-mapping>
<filter-name>fhir2AuthenticationFilter</filter-name>
<url-pattern>/ws/fhir2</url-pattern>
<url-pattern>/ws/fhir2/*</url-pattern>
<url-pattern>/ms/fhir2Servlet</url-pattern>
<url-pattern>/ms/fhir2Servlet/*</url-pattern>
</filter-mapping>
<filter>
Expand All @@ -65,6 +67,7 @@
</filter>
<filter-mapping>
<filter-name>fhir2ForwardingFilter</filter-name>
<url-pattern>/ws/fhir2</url-pattern>
<url-pattern>/ws/fhir2/*</url-pattern>
</filter-mapping>

Expand Down

0 comments on commit dd3960d

Please sign in to comment.