case-insensitive URI scheme comparison
Required according to RFC 3986: > An implementation should accept uppercase letters as equivalent to > lowercase in scheme names Closes #330
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "config/Block.hxx"
|
||||
#include "input/InputStream.hxx"
|
||||
#include "tag/TagBuilder.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/Alloc.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
@@ -68,7 +69,7 @@ soundcloud_resolve(const char* uri)
|
||||
{
|
||||
char *u, *ru;
|
||||
|
||||
if (StringStartsWith(uri, "https://")) {
|
||||
if (StringStartsWithCaseASCII(uri, "https://")) {
|
||||
u = xstrdup(uri);
|
||||
} else if (StringStartsWith(uri, "soundcloud.com")) {
|
||||
u = xstrcatdup("https://", uri);
|
||||
@@ -273,7 +274,7 @@ try {
|
||||
static SongEnumerator *
|
||||
soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
|
||||
{
|
||||
assert(strncmp(uri, "soundcloud://", 13) == 0);
|
||||
assert(StringEqualsCaseASCII(uri, "soundcloud://", 13));
|
||||
uri += 13;
|
||||
|
||||
char *u = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user