Skip to content

Commit e18a626

Browse files
committed
CLAP-372 Chore: 다중 파라미터 xss 공격 테스트 api 구현
<footer> - 관련: #475
1 parent bd74088 commit e18a626

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/main/java/clap/server/adapter/inbound/web/XssTestController.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class XssTestController {
1515

1616
@GetMapping
1717
@DevelopOnlyApi
18-
@Operation(summary = "파라미터 xss test")
18+
@Operation(summary = "단일 파라미터 xss test")
1919
public ResponseEntity<String> testGetXss(@RequestParam String input) {
2020
log.info("Received GET input: {}", input);
2121
return ResponseEntity.ok("Processed GET input: " + input);
@@ -28,4 +28,20 @@ public ResponseEntity<XssTestResponse> testPostXss(@RequestBody XssTestRequest r
2828
log.info("Received POST input: {}", request);
2929
return ResponseEntity.ok(new XssTestResponse(request.content()));
3030
}
31+
32+
@GetMapping("/multi-params")
33+
@Operation(summary = "다중 파라미터 XSS 테스트")
34+
public ResponseEntity<String> testMultiParamXss(@RequestParam(value = "inputs", required = false) String[] inputs) {
35+
if (inputs == null || inputs.length == 0) {
36+
return ResponseEntity.badRequest().body("No inputs provided");
37+
}
38+
39+
StringBuilder response = new StringBuilder("Processed inputs:\n");
40+
for (int i = 0; i < inputs.length; i++) {
41+
log.info("Received input {}: {}", i, inputs[i]);
42+
response.append("Input ").append(i).append(": ").append(inputs[i]).append("\n");
43+
}
44+
45+
return ResponseEntity.ok(response.toString());
46+
}
3147
}

0 commit comments

Comments
 (0)