We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef52124 commit 69f3e8fCopy full SHA for 69f3e8f
app/src/main/java/hexlet/code/controller/UrlsController.java
@@ -13,7 +13,6 @@
13
import java.net.URI;
14
import java.net.URISyntaxException;
15
import java.sql.SQLException;
16
-import java.util.Objects;
17
18
import static io.javalin.rendering.template.TemplateUtil.model;
19
@@ -48,10 +47,7 @@ public static void show(Context ctx) throws SQLException {
48
47
49
public static void create(Context ctx) throws SQLException {
50
51
- var inputUrl = ctx.formParamAsClass("url", String.class)
52
- .check(Objects::nonNull, "Url not found in form")
53
- .getOrThrow(NotFoundResponse::new);
54
-
+ var inputUrl = ctx.formParam("url");
55
URI parsedUrl;
56
try {
57
parsedUrl = new URI(inputUrl);
0 commit comments