Use 404 code when rejecting invalid project id

This commit is contained in:
Shane Kilkelly 2019-08-02 10:46:15 +01:00
parent 76b349591c
commit ac4f4082c8
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ public class Oauth2Filter implements Filter {
String requestUri = ((Request) servletRequest).getRequestURI(); String requestUri = ((Request) servletRequest).getRequestURI();
if (requestUri.startsWith("/project")) { if (requestUri.startsWith("/project")) {
Log.info("[{}] Invalid request URI", requestUri); Log.info("[{}] Invalid request URI", requestUri);
sendResponse(servletResponse,400, Arrays.asList( sendResponse(servletResponse,404, Arrays.asList(
"Invalid Project ID (must not have a '/project' prefix)" "Invalid Project ID (must not have a '/project' prefix)"
)); ));
return; return;

View file

@ -885,7 +885,7 @@ public class WLGitBridgeIntegrationTest {
assertEquals(Arrays.asList( assertEquals(Arrays.asList(
"Cloning into '1234abcd'...", "Cloning into '1234abcd'...",
"remote: Invalid Project ID (must not have a '/project' prefix)", "remote: Invalid Project ID (must not have a '/project' prefix)",
"fatal: unable to access 'http://127.0.0.1:33886/project/1234abcd/': The requested URL returned error: 400" "fatal: repository 'http://127.0.0.1:33886/project/1234abcd/' not found"
), actual); ), actual);
wlgb.stop(); wlgb.stop();