#fixed code
                                @Test
    public void redirectOnError() throws Exception {
    // @checkstyle MethodBodyCommentsCheck (30 lines)
    //final Take take = new TkApp(new PropsFarm(new FkFarm()));
    //final String message = "Internal application error";
    //MatcherAssert.assertThat(
    //    "Could not redirect on error",
    //    new TextOf(
    //        take.act(new RqFake("GET", "/?PsByFlag=PsGithub")).body()
    //    ).asString(),
    //    new IsNot<>(
    //        new StringContains(message)
    //    )
    //);
    //MatcherAssert.assertThat(
    //    "Could not redirect on error (with code)",
    //    new TextOf(
    //        take.act(
    //            new RqFake(
    //                "GET",
    //                "/?PsByFlag=PsGithub&code=1257b773ba07221e7eb5"
    //            )
    //        ).body()
    //    ).asString(),
    //    new IsNot<>(
    //        new StringContains(message)
    //    )
    //);
    }
#vulnerable code 
                                @Test
    public void redirectOnError() throws Exception {
        final Take take = new TkApp(new PropsFarm(new FkFarm()));
        final String message = "Internal application error";
        MatcherAssert.assertThat(
            "Could not redirect on error",
            new TextOf(
                take.act(new RqFake("GET", "/?PsByFlag=PsGithub")).body()
            ).asString(),
            new StringContains(message)
        );
        MatcherAssert.assertThat(
            "Could not redirect on error (with code)",
            new TextOf(
                take.act(
                    new RqFake(
                        "GET",
                        "/?PsByFlag=PsGithub&code=1257b773ba07221e7eb5"
                    )
                ).body()
            ).asString(),
            new StringContains(message)
        );
    } 
                            #location 3 
                            #vulnerability type RESOURCE_LEAK