summaryrefslogtreecommitdiffstats
path: root/src/core/uri.c
diff options
context:
space:
mode:
authorMichael Brown2016-03-13 15:51:15 +0100
committerMichael Brown2016-03-13 15:51:15 +0100
commit17c1488a441756974d77d52a2b84c9c439327b47 (patch)
treeffefcf7fe4b330e97b42aa766432ee12cc5fd916 /src/core/uri.c
parent[efi] Add processor binding headers for ARM and AArch64 (diff)
downloadipxe-17c1488a441756974d77d52a2b84c9c439327b47.tar.gz
ipxe-17c1488a441756974d77d52a2b84c9c439327b47.tar.xz
ipxe-17c1488a441756974d77d52a2b84c9c439327b47.zip
[uri] Support URIs containing only scheme and path components
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/uri.c')
-rw-r--r--src/core/uri.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/uri.c b/src/core/uri.c
index aa6eedb9..0abd8bdc 100644
--- a/src/core/uri.c
+++ b/src/core/uri.c
@@ -456,7 +456,6 @@ unsigned int uri_port ( const struct uri *uri, unsigned int default_port ) {
*/
size_t format_uri ( const struct uri *uri, char *buf, size_t len ) {
static const char prefixes[URI_FIELDS] = {
- [URI_OPAQUE] = ':',
[URI_PASSWORD] = ':',
[URI_PORT] = ':',
[URI_QUERY] = '?',
@@ -495,9 +494,9 @@ size_t format_uri ( const struct uri *uri, char *buf, size_t len ) {
( buf + used ), ( len - used ) );
/* Suffix this field, if applicable */
- if ( ( field == URI_SCHEME ) && ( ! uri->opaque ) ) {
+ if ( field == URI_SCHEME ) {
used += ssnprintf ( ( buf + used ), ( len - used ),
- "://" );
+ ":%s", ( uri->host ? "//" : "" ) );
}
}