diff options
| author | Michael Brown | 2021-07-01 17:32:46 +0200 |
|---|---|---|
| committer | Michael Brown | 2021-07-01 17:32:46 +0200 |
| commit | 2690f730961e335875cac5fd9cf870a94eaef11a (patch) | |
| tree | a995bdb321936ffdeb50dc57dd5845abe02741c9 /src/net | |
| parent | [rdc] Add driver for RDC R6040 embedded NIC (diff) | |
| download | ipxe-2690f730961e335875cac5fd9cf870a94eaef11a.tar.gz ipxe-2690f730961e335875cac5fd9cf870a94eaef11a.tar.xz ipxe-2690f730961e335875cac5fd9cf870a94eaef11a.zip | |
[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/net')
| -rw-r--r-- | src/net/tcp/httpconn.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tcp/httpconn.c b/src/net/tcp/httpconn.c index f9221b27e..538c4dcf6 100644 --- a/src/net/tcp/httpconn.c +++ b/src/net/tcp/httpconn.c @@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdlib.h> #include <string.h> +#include <strings.h> #include <errno.h> #include <byteswap.h> #include <ipxe/tcpip.h> @@ -63,7 +64,7 @@ static struct http_scheme * http_scheme ( struct uri *uri ) { /* 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; } |
