aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-07-01 16:32:46 +0100
committerMichael Brown <mcb30@ipxe.org>2021-07-01 16:32:46 +0100
commit2690f730961e335875cac5fd9cf870a94eaef11a (patch)
treea995bdb321936ffdeb50dc57dd5845abe02741c9 /src/core
parent4aa03758210d861dacb0531062576287ac76e353 (diff)
downloadipxe-2690f730961e335875cac5fd9cf870a94eaef11a.zip
ipxe-2690f730961e335875cac5fd9cf870a94eaef11a.tar.gz
ipxe-2690f730961e335875cac5fd9cf870a94eaef11a.tar.bz2
[uri] Make URI schemes case-insensitive
RFC 3986 section 3.1 defines URI schemes as case-insensitive (though the canonical form is always lowercase). Use strcasecmp() rather than strcmp() to allow for case insensitivity in URI schemes. Requested-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/open.c b/src/core/open.c
index c27d8a0..f9198c9 100644
--- a/src/core/open.c
+++ b/src/core/open.c
@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdarg.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include <ipxe/xfer.h>
#include <ipxe/uri.h>
@@ -47,7 +48,7 @@ struct uri_opener * xfer_uri_opener ( const char *scheme ) {
struct uri_opener *opener;
for_each_table_entry ( opener, URI_OPENERS ) {
- if ( strcmp ( scheme, opener->scheme ) == 0 )
+ if ( strcasecmp ( scheme, opener->scheme ) == 0 )
return opener;
}
return NULL;