aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/uri.c b/src/uri.c
index 6b4fc07e..fcea3b62 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -103,16 +103,12 @@ serd_uri_string_has_scheme(const uint8_t* utf8)
if (!utf8 || !is_alpha(utf8[0])) {
return false; // Invalid scheme initial character, URI is relative
}
+
for (uint8_t c; (c = *++utf8) != '\0';) {
- switch (c) {
- case ':':
+ if (!is_uri_scheme_char(c)) {
+ return false;
+ } else if (c == ':') {
return true; // End of scheme
- case '+': case '-': case '.':
- break; // Valid scheme character, continue
- default:
- if (!is_alpha(c) && !is_digit(c)) {
- return false; // Invalid scheme character
- }
}
}