Skip to content

Commit

Permalink
Added parallel endpoint to simulate span misalignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinZakharov committed Sep 24, 2024
1 parent 8ea732c commit ed28835
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import java.sql.DriverManager;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import datadog.smoketest.appsec.springboot.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -20,6 +23,10 @@

@RestController
public class WebController {

@Autowired
private MyAsyncService myAsyncService;

@RequestMapping("/greeting")
public String greeting() {
return "Sup AppSec Dawg";
Expand All @@ -46,6 +53,12 @@ public String sqliQuery(@RequestParam("id") String id) throws Exception {
return "EXECUTED";
}

@GetMapping("parallel/sqli/query")
public String sqliQueryParallel(@RequestParam("id") String id) {
myAsyncService.performAsyncTask(id);
return "EXECUTED";
}

@GetMapping("/sqli/header")
public String sqliHeader(@RequestHeader("x-custom-header") String id) throws Exception {
Connection conn = DriverManager.getConnection("jdbc:h2:mem:testdb", "sa", "");
Expand Down

0 comments on commit ed28835

Please sign in to comment.