From 89eb5526ce43a3e608b9f38fe35b297ee3780d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Draga=C5=84czuk?= Date: Sun, 16 Feb 2020 16:08:06 +0100 Subject: [PATCH] Added dashes and underscores to permitted characters --- src/main/java/tk/draganczuk/url/Utils.java | 2 +- src/main/resources/public/index.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/tk/draganczuk/url/Utils.java b/src/main/java/tk/draganczuk/url/Utils.java index 9292067..174a7b5 100644 --- a/src/main/java/tk/draganczuk/url/Utils.java +++ b/src/main/java/tk/draganczuk/url/Utils.java @@ -6,7 +6,7 @@ import java.util.regex.Pattern; public class Utils { private static final Random random = new Random(System.currentTimeMillis()); - private static final String SHORT_URL_PATTERN = "[a-z0-9]+"; + private static final String SHORT_URL_PATTERN = "[a-z0-9_-]+"; private static final Pattern PATTERN = Pattern.compile(SHORT_URL_PATTERN); public static String randomString() { diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html index e53d4fe..897ebb3 100644 --- a/src/main/resources/public/index.html +++ b/src/main/resources/public/index.html @@ -33,9 +33,10 @@
- + + pattern="[a-z0-9_-]+"/>