diff --git a/common/network/websocket.c b/common/network/websocket.c index 2325cb9..52c5183 100644 --- a/common/network/websocket.c +++ b/common/network/websocket.c @@ -46,6 +46,9 @@ settings_t settings; extern int wakeuppipe[2]; +extern char *extra_headers; +extern unsigned extra_headers_len; + void traffic(const char * token) { /*if ((settings.verbose) && (! settings.daemon)) { fprintf(stdout, "%s", token); @@ -836,7 +839,8 @@ static void dirlisting(ws_ctx_t *ws_ctx, const char fullpath[], const char path[ "Location: %s/\r\n" "Connection: close\r\n" "Content-type: text/plain\r\n" - "\r\n", path); + "%s" + "\r\n", path, extra_headers ? extra_headers : ""); ws_send(ws_ctx, buf, strlen(buf)); weblog(301, wsthread_handler_id, 0, origip, ip, user, 1, path, strlen(buf)); return; @@ -850,7 +854,9 @@ static void dirlisting(ws_ctx_t *ws_ctx, const char fullpath[], const char path[ "Server: KasmVNC/4.0\r\n" "Connection: close\r\n" "Content-type: text/html\r\n" - "\r\nDirectory Listing

%s