Skip to content

Commit 1484730

Browse files
committed
fix spotless
1 parent bdb6349 commit 1484730

File tree

1 file changed

+5
-6
lines changed
  • languages/jvm/java.com/services/micronaut.io/src/main/java/io/proxy/reverse/controller

1 file changed

+5
-6
lines changed

languages/jvm/java.com/services/micronaut.io/src/main/java/io/proxy/reverse/controller/ProxyController.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
import io.micronaut.scheduling.TaskExecutors;
88
import io.micronaut.scheduling.annotation.ExecuteOn;
99
import jakarta.inject.Inject;
10+
import java.net.URI;
1011
import org.slf4j.Logger;
1112
import org.slf4j.LoggerFactory;
1213

13-
import java.net.URI;
14-
1514
/**
16-
* A simple proxy controller that retrieves the content of a given URL.
17-
* Runs on a blocking thread pool to avoid blocking the event loop.
15+
* A simple proxy controller that retrieves the content of a given URL. Runs on a blocking thread
16+
* pool to avoid blocking the event loop.
1817
*/
1918
@Controller("/proxy")
2019
public class ProxyController {
@@ -38,8 +37,8 @@ public HttpResponse<?> proxy(@QueryValue String url) {
3837
try {
3938
// ✅ Validate and sanitize the provided URL
4039
URI targetUri = URI.create(url);
41-
if (!("http".equalsIgnoreCase(targetUri.getScheme()) ||
42-
"https".equalsIgnoreCase(targetUri.getScheme()))) {
40+
if (!("http".equalsIgnoreCase(targetUri.getScheme())
41+
|| "https".equalsIgnoreCase(targetUri.getScheme()))) {
4342
return HttpResponse.badRequest("Invalid URL scheme — only http/https allowed");
4443
}
4544

0 commit comments

Comments
 (0)