We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fdac73 commit e90052dCopy full SHA for e90052d
src/main/java/org/example/filter/redirect/RedirectRule.java
@@ -10,6 +10,10 @@ public final class RedirectRule {
10
public RedirectRule(Pattern sourcePattern, String targetUrl, int statusCode) {
11
this.sourcePattern = Objects.requireNonNull(sourcePattern, "sourcePattern");
12
this.targetUrl = Objects.requireNonNull(targetUrl, "targetUrl");
13
+ if (this.targetUrl.isBlank()) {
14
+ throw new IllegalArgumentException("targetUrl must not be blank");
15
+}
16
+
17
if (statusCode != 301 && statusCode != 302) {
18
throw new IllegalArgumentException("statusCode must be 301 or 302");
19
}
@@ -32,4 +36,4 @@ public String toString() {
32
36
", statusCode=" + statusCode +
33
37
'}';
34
38
35
-}
39
0 commit comments