Allow digits in URL schemes per RFC

This commit is contained in:
Seth Hitchings committed 2012-04-27 11:25:04 -07:00
1 parent 89ddd131e4
commit d39f7ab3fc
2 files changed
+19 -1

No files matched your search

@@ -12,7 +12,9 @@ import org.scribe.model.OAuthConstants;
public class Preconditions
{
private static final String DEFAULT_MESSAGE = "Received an invalid parameter";
private static final Pattern URL_PATTERN = Pattern.compile("[a-zA-Z_-]+://\\S+");
// scheme = alpha *( alpha | digit | "+" | "-" | "." )
private static final Pattern URL_PATTERN = Pattern.compile("^[a-zA-Z][a-zA-Z0-9+.-]*://\\S+");
/**
* Checks that an object is not null.