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>
#include <stdarg.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include <ipxe/xfer.h>
#include <ipxe/uri.h>
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;
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/tcpip.h>
/* Identify scheme */
for_each_table_entry ( scheme, HTTP_SCHEMES ) {
- if ( strcmp ( uri->scheme, scheme->name ) == 0 )
+ if ( strcasecmp ( uri->scheme, scheme->name ) == 0 )
return scheme;
}