diff options
-rw-r--r-- | json-rpc-shell.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c index c5142f6..f15d5db 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -1307,9 +1307,12 @@ backend_ws_connect (struct app_context *ctx, struct error **e) struct str url_path; str_init (&url_path); - str_append_data (&url_path, self->endpoint + - self->url.field_data[UF_PATH].off, - self->url.field_data[UF_PATH].len); + if (self->url.field_set & (1 << UF_PATH)) + str_append_data (&url_path, self->endpoint + + self->url.field_data[UF_PATH].off, + self->url.field_data[UF_PATH].len); + else + str_append_c (&url_path, '/'); if (self->url.field_set & (1 << UF_QUERY)) { str_append_c (&url_path, '?'); |