Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3279,7 +3279,10 @@ manifest:
- weblog_declaration:
"*": missing_feature
spring-boot: v1.47.0
tests/test_resource_renaming.py: missing_feature
tests/test_resource_renaming.py:
- weblog_declaration:
"*": missing_feature
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/test_rum_injection.py:
- weblog_declaration:
"*": irrelevant (RUM injection only supported for spring-boot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ import akka.http.scaladsl.server.Route

object MainRoutes {

val route: Route = path("sample_rate_route" / """\d{1,3}""".r) { (i) =>
get {
complete(
HttpResponse(
status = StatusCodes.OK,
entity = HttpEntity(ContentTypes.`text/plain(UTF-8)`, "OK\n")
val route: Route =
path("sample_rate_route" / """\d{1,3}""".r) { (i) =>
get {
complete(
HttpResponse(
status = StatusCodes.OK,
entity = HttpEntity(ContentTypes.`text/plain(UTF-8)`, "OK\n")
)
)
)
}
} ~
pathPrefix("resource_renaming") {
get {
complete(
HttpResponse(
status = StatusCodes.OK,
entity = HttpEntity(ContentTypes.`text/plain(UTF-8)`, "ok")
)
)
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ public String waf() {
return "Hello world!";
}

@GET
@Path("/resource_renaming/{path: .*}")
public String resourceRenaming(@PathParam("path") String path) {
return "ok";
}

@POST
@Path("/waf")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ class MainController @Inject()(cc: MessagesControllerComponents, ws: WSClient, m
Results.Status(200)("OK!\n")
.as("text/plain; charset=utf-8")
}

def resourceRenaming(path: String) = Action { request =>
Ok("ok")
}
}
1 change: 1 addition & 0 deletions utils/build/docker/java/play/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ GET /sample_rate_route/:i controllers.MainController.sampleRateRoute(i: Int
GET /api_security/sampling/:i controllers.AppSecController.apiSecuritySamplingWithStatus(i: Int)
GET /api_security_sampling/:i controllers.AppSecController.apiSecuritySampling(i: Int)
GET /params/*segments controllers.AppSecController.params(segments: Seq[String])
GET /resource_renaming/*path controllers.MainController.resourceRenaming(path: String)
GET /waf controllers.AppSecController.waf
GET /waf/ controllers.AppSecController.waf
GET /waf/*segments controllers.AppSecController.params(segments: Seq[String])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ public static void main(String[] args) throws Exception {
})
.get("params/:params?:.*",
ctx -> ctx.getResponse().send("text/plain", ctx.getPathTokens().toString()))
.get("resource_renaming/:path?:.*",
ctx -> ctx.getResponse().send("text/plain", "ok"))
.path("status", ctx -> {
String codeParam = ctx.getRequest().getQueryParams().get("code");
int code = Integer.parseInt(codeParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ public String waf() {
return "Hello world!";
}

@GET
@Path("/resource_renaming/{path: .*}")
public String resourceRenaming(@PathParam("path") String path) {
return "ok";
}

@POST
@Path("/waf")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,11 @@ public ResponseEntity<String> protobufDeserialize(@RequestParam("msg") final Str
return ResponseEntity.ok("ok");
}

@GetMapping("/resource_renaming/{*path}")
public String resourceRenaming(@PathVariable(required = false) String path) {
return "ok";
}

@Bean
@ConditionalOnProperty(
value="spring.native",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ public static void main(String[] args) {
ctx.pathParams().toString();
ctx.response().end("Hello world!");
});
router.getWithRegex("/resource_renaming(?:/(.*))?").handler(ctx -> {
// Consume path params
ctx.pathParams().toString();
ctx.response().end("ok");
});
router.post("/waf").handler(BodyHandler.create());
router.post("/waf").consumes("application/x-www-form-urlencoded")
.produces("text/plain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public static void main(String[] args) {
ctx.pathParams().toString();
ctx.response().end("Hello world!");
});
router.getWithRegex("/resource_renaming(?:/(.*))?").handler(ctx -> {
// Consume path params
ctx.pathParams().toString();
ctx.response().end("ok");
});
router.post("/waf").handler(BodyHandler.create());
router.post("/waf").consumes("application/x-www-form-urlencoded")
.produces("text/plain")
Expand Down
Loading