Skip to content

Commit

Permalink
Responding to 'wfs3' instead of just 'wfs3/'
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed May 28, 2018
1 parent 7c7988b commit 9e2f204
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private class RequestWrapper extends HttpServletRequestWrapper {
private RequestWrapper(HttpServletRequest wrapped) { private RequestWrapper(HttpServletRequest wrapped) {
super(wrapped); super(wrapped);
String pathInfo = wrapped.getPathInfo(); String pathInfo = wrapped.getPathInfo();
if (pathInfo.equals("/")) { if (pathInfo.equals("/") || pathInfo.equals("")) {
request = "landingPage"; request = "landingPage";
} else if (pathInfo.equals("/api") || pathInfo.equals("/api/")) { } else if (pathInfo.equals("/api") || pathInfo.equals("/api/")) {
request = "api"; request = "api";
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
public class LandingPageTest extends WFS3TestSupport { public class LandingPageTest extends WFS3TestSupport {


@Test @Test
public void testLandingPageNoFormat() throws Exception { public void testLandingPageNoSlah() throws Exception {
DocumentContext json = getAsJSONPath("wfs3", 200);
checkJSONLandingPage(json);
}

@Test
public void testLandingPageSlash() throws Exception {
DocumentContext json = getAsJSONPath("wfs3/", 200); DocumentContext json = getAsJSONPath("wfs3/", 200);
checkJSONLandingPage(json); checkJSONLandingPage(json);
} }


@Test @Test
public void testLandingPageJSON() throws Exception { public void testLandingPageJSON() throws Exception {
DocumentContext json = getAsJSONPath("wfs3/?f=json", 200); DocumentContext json = getAsJSONPath("wfs3?f=json", 200);
checkJSONLandingPage(json); checkJSONLandingPage(json);
} }


Expand Down

0 comments on commit 9e2f204

Please sign in to comment.