aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-15 04:30:48 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-15 04:30:48 +0200
commit6927d022fb27673c4204a323fb425f317cd1affa (patch)
treea507260336ec381f7fc9efc3f59093c164c0cc49
parent75b2094cdd893bff4fb6e28f228f134701eee15a (diff)
downloadjson-rpc-shell-6927d022fb27673c4204a323fb425f317cd1affa.tar.gz
json-rpc-shell-6927d022fb27673c4204a323fb425f317cd1affa.tar.xz
json-rpc-shell-6927d022fb27673c4204a323fb425f317cd1affa.zip
WebSocket: send a User-Agent header
-rw-r--r--json-rpc-shell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index 38ff022..639c261 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -2291,6 +2291,8 @@ backend_ws_connect (struct ws_context *self, struct error **e)
str_append_printf (&request, "GET %s HTTP/1.1\r\n", url_path.str);
// TODO: omit the port if it's the default (check RFC for "SHOULD" or ...)
str_append_printf (&request, "Host: %s:%s\r\n", url_host, url_port);
+ str_append_printf (&request, "User-Agent: %s/%s\r\n",
+ PROGRAM_NAME, PROGRAM_VERSION);
str_append_printf (&request, "Upgrade: websocket\r\n");
str_append_printf (&request, "Connection: upgrade\r\n");
str_append_printf (&request, SEC_WS_KEY ": %s\r\n", key_b64_string);