From c05ee8f4aed615b790952159153e7700cf9154df Mon Sep 17 00:00:00 2001 From: Jed Lu Date: Tue, 15 Dec 2020 17:53:38 -0800 Subject: [PATCH] ss: http: make sure we dont duplicate leading path slash if already present --- lib/secure-streams/protocols/ss-h1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index 5e1236508..028776a68 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -758,6 +758,11 @@ secstream_connect_munge_h1(lws_ss_handle_t *h, char *buf, size_t len, /* protocol aux is the path part */ i->path = buf; + + /* skip the unnessary '/' */ + if (*pbasis == '/') + pbasis = pbasis + 1; + buf[0] = '/'; lws_strexp_init(&exp, (void *)h, lws_ss_exp_cb_metadata, buf + 1, len - 1);