1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

redirect: make sure we start with / on path

This commit is contained in:
Andy Green 2021-06-22 14:56:36 +01:00
parent 272dba8307
commit 8c122cd8bd

View file

@ -88,7 +88,7 @@ lws_client_stash_create(struct lws *wsi, const char **cisin)
char *pc;
int n;
size = sizeof(*wsi->stash);
size = sizeof(*wsi->stash) + 1;
/*
* Let's overallocate the stash object with space for all the args
@ -114,6 +114,8 @@ lws_client_stash_create(struct lws *wsi, const char **cisin)
if (cisin[n]) {
size_t mm;
wsi->stash->cis[n] = pc;
if (n == CIS_PATH && cisin[n][0] != '/')
*pc++ = '/';
mm = strlen(cisin[n]) + 1;
memcpy(pc, cisin[n], mm);
pc += mm;