mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 09:16:46 +00:00
Change invalid shorturl error message
This commit is contained in:
parent
0ef85242ec
commit
81fc707d27
@ -34,7 +34,7 @@ public class Routes {
|
||||
return urlRepository.addUrl(longUrl, shortUrl);
|
||||
} else {
|
||||
res.status(HttpStatus.BAD_REQUEST_400);
|
||||
return "shortUrl not valid ([a-z0-9]+)";
|
||||
return "shortUrl not valid ([a-z0-9-_]+)";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user