Skip to content

Commit 8eaffaf

Browse files
committed
Fix test mistakes
1 parent 6b3bc42 commit 8eaffaf

File tree

1 file changed

+6
-6
lines changed
  • java/ql/test/query-tests/security/CWE-079/semmle/tests

1 file changed

+6
-6
lines changed

java/ql/test/query-tests/security/CWE-079/semmle/tests/JaxXSS.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ public static Response specificContentType(boolean safeContentType, boolean chai
3737
else {
3838
if(chainDirectly) {
3939
if(contentTypeFirst)
40-
return builder.type(MediaType.APPLICATION_JSON).entity(userControlled).build(); // $xss
40+
return builder.type(MediaType.APPLICATION_JSON).entity(userControlled).build();
4141
else
42-
return builder.entity(userControlled).type(MediaType.APPLICATION_JSON).build(); // $xss
42+
return builder.entity(userControlled).type(MediaType.APPLICATION_JSON).build();
4343
}
4444
else {
4545
if(contentTypeFirst) {
4646
Response.ResponseBuilder builder2 = builder.type(MediaType.APPLICATION_JSON);
47-
return builder2.entity(userControlled).build(); // $xss
47+
return builder2.entity(userControlled).build();
4848
}
4949
else {
5050
Response.ResponseBuilder builder2 = builder.entity(userControlled);
51-
return builder2.type(MediaType.APPLICATION_JSON).build(); // $xss
51+
return builder2.type(MediaType.APPLICATION_JSON).build();
5252
}
5353
}
5454
}
@@ -188,7 +188,7 @@ public static Response methodContentTypeUnsafeOverriddenWithSafe(String userCont
188188

189189
@Path("/abc")
190190
@Produces({"application/json"})
191-
private static class ClassContentTypeSafe {
191+
public static class ClassContentTypeSafe {
192192
@GET
193193
public Response test(String userControlled) {
194194
return Response.ok(userControlled).build();
@@ -212,7 +212,7 @@ public Response overridesWithUnsafe2(String userControlled) {
212212

213213
@Path("/abc")
214214
@Produces({"text/html"})
215-
private static class ClassContentTypeUnsafe {
215+
public static class ClassContentTypeUnsafe {
216216
@GET
217217
public Response test(String userControlled) {
218218
return Response.ok(userControlled).build(); // $MISSING: xss

0 commit comments

Comments
 (0)